[PATCH weston 10/21] libweston: rename weston_output_destroy() to weston_output_release()

Pekka Paalanen ppaalanen at gmail.com
Fri Sep 22 14:31:18 UTC 2017


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

'release' is a more appropriate name because the function does not free
the underlying memory. The main reason for this is that we need the name
weston_output_destroy() for new API that actually will free also the
underlying memory.

Since the function is only used in backends and external backends are
not a thing, this does not cause libweston major version bump, even
though it does change the ABI. There is no way external users could have
successfully used this function.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 libweston/compositor-drm.c      | 2 +-
 libweston/compositor-fbdev.c    | 2 +-
 libweston/compositor-headless.c | 2 +-
 libweston/compositor-rdp.c      | 4 ++--
 libweston/compositor-wayland.c  | 6 +++---
 libweston/compositor-x11.c      | 2 +-
 libweston/compositor.c          | 4 ++--
 libweston/compositor.h          | 2 +-
 8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 19509907..20da4ef1 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -3272,7 +3272,7 @@ drm_output_destroy(struct weston_output *base)
 	if (output->pageflip_timer)
 		wl_event_source_remove(output->pageflip_timer);
 
-	weston_output_destroy(&output->base);
+	weston_output_release(&output->base);
 
 	drm_property_info_free(output->props_conn, WDRM_CONNECTOR__COUNT);
 
diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c
index 33fa61d9..04f1dfe2 100644
--- a/libweston/compositor-fbdev.c
+++ b/libweston/compositor-fbdev.c
@@ -555,7 +555,7 @@ fbdev_output_destroy(struct weston_output *base)
 	fbdev_output_disable_handler(base);
 
 	/* Remove the output. */
-	weston_output_destroy(&output->base);
+	weston_output_release(&output->base);
 
 	free(output->device);
 	free(output);
diff --git a/libweston/compositor-headless.c b/libweston/compositor-headless.c
index ac762c18..64fe6f3f 100644
--- a/libweston/compositor-headless.c
+++ b/libweston/compositor-headless.c
@@ -134,7 +134,7 @@ headless_output_destroy(struct weston_output *base)
 	struct headless_output *output = to_headless_output(base);
 
 	headless_output_disable(&output->base);
-	weston_output_destroy(&output->base);
+	weston_output_release(&output->base);
 
 	free(output);
 }
diff --git a/libweston/compositor-rdp.c b/libweston/compositor-rdp.c
index ca560b3c..226387c8 100644
--- a/libweston/compositor-rdp.c
+++ b/libweston/compositor-rdp.c
@@ -566,7 +566,7 @@ rdp_output_destroy(struct weston_output *base)
 	struct rdp_output *output = to_rdp_output(base);
 
 	rdp_output_disable(&output->base);
-	weston_output_destroy(&output->base);
+	weston_output_release(&output->base);
 
 	free(output);
 }
@@ -1355,7 +1355,7 @@ rdp_backend_create(struct weston_compositor *compositor,
 err_listener:
 	freerdp_listener_free(b->listener);
 err_output:
-	weston_output_destroy(&b->output->base);
+	weston_output_release(&b->output->base);
 err_compositor:
 	weston_compositor_shutdown(compositor);
 err_free_strings:
diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
index e8639a0e..26cfdd59 100644
--- a/libweston/compositor-wayland.c
+++ b/libweston/compositor-wayland.c
@@ -703,7 +703,7 @@ wayland_output_destroy(struct weston_output *base)
 
 	wayland_output_disable(&output->base);
 
-	weston_output_destroy(&output->base);
+	weston_output_release(&output->base);
 
 	if (output->frame_cb)
 		wl_callback_destroy(output->frame_cb);
@@ -1376,7 +1376,7 @@ wayland_output_create_for_parent_output(struct wayland_backend *b,
 	return 0;
 
 out:
-	weston_output_destroy(&output->base);
+	weston_output_release(&output->base);
 	free(output->title);
 	free(output);
 
@@ -1424,7 +1424,7 @@ wayland_output_create_fullscreen(struct wayland_backend *b)
 err_set_size:
 	wayland_backend_destroy_output_surface(output);
 err_surface:
-	weston_output_destroy(&output->base);
+	weston_output_release(&output->base);
 	free(output->title);
 	free(output);
 
diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c
index 9d371428..070f2875 100644
--- a/libweston/compositor-x11.c
+++ b/libweston/compositor-x11.c
@@ -801,7 +801,7 @@ x11_output_destroy(struct weston_output *base)
 	struct x11_output *output = to_x11_output(base);
 
 	x11_output_disable(&output->base);
-	weston_output_destroy(&output->base);
+	weston_output_release(&output->base);
 
 	free(output);
 }
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 4690b37c..baa8a751 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -4751,7 +4751,7 @@ weston_output_init(struct weston_output *output,
  * Also notifies the compositor that an output is pending for
  * configuration.
  *
- * The opposite of this operation is built into weston_output_destroy().
+ * The opposite of this operation is built into weston_output_release().
  *
  * \memberof weston_output
  * \internal
@@ -4932,7 +4932,7 @@ weston_pending_output_coldplug(struct weston_compositor *compositor)
  * \internal
  */
 WL_EXPORT void
-weston_output_destroy(struct weston_output *output)
+weston_output_release(struct weston_output *output)
 {
 	output->destroying = 1;
 
diff --git a/libweston/compositor.h b/libweston/compositor.h
index 804d0912..8b2d2b06 100644
--- a/libweston/compositor.h
+++ b/libweston/compositor.h
@@ -1717,7 +1717,7 @@ void
 weston_output_move(struct weston_output *output, int x, int y);
 
 void
-weston_output_destroy(struct weston_output *output);
+weston_output_release(struct weston_output *output);
 void
 weston_output_transform_coordinate(struct weston_output *output,
 				   double device_x, double device_y,
-- 
2.13.5



More information about the wayland-devel mailing list