[PATCH weston 8/8] clients: destroy wl_registry on exit

Pekka Paalanen ppaalanen at gmail.com
Fri Nov 23 05:56:57 PST 2012


Plug an insignificant memory leak in demo programs that bother to clean
up at all.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 clients/simple-egl.c |    1 +
 clients/simple-shm.c |    1 +
 clients/window.c     |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/clients/simple-egl.c b/clients/simple-egl.c
index 12bc93d..c073330 100644
--- a/clients/simple-egl.c
+++ b/clients/simple-egl.c
@@ -676,6 +676,7 @@ main(int argc, char **argv)
 	if (display.compositor)
 		wl_compositor_destroy(display.compositor);
 
+	wl_registry_destroy(display.registry);
 	wl_display_flush(display.display);
 	wl_display_disconnect(display.display);
 
diff --git a/clients/simple-shm.c b/clients/simple-shm.c
index 5bc26bf..831f9a4 100644
--- a/clients/simple-shm.c
+++ b/clients/simple-shm.c
@@ -369,6 +369,7 @@ destroy_display(struct display *display)
 	if (display->compositor)
 		wl_compositor_destroy(display->compositor);
 
+	wl_registry_destroy(display->registry);
 	wl_display_flush(display->display);
 	wl_display_disconnect(display->display);
 	free(display);
diff --git a/clients/window.c b/clients/window.c
index 0279aae..e2e6f88 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -4237,6 +4237,7 @@ display_destroy(struct display *display)
 		wl_data_device_manager_destroy(display->data_device_manager);
 
 	wl_compositor_destroy(display->compositor);
+	wl_registry_destroy(display->registry);
 
 	close(display->epoll_fd);
 
-- 
1.7.8.6



More information about the wayland-devel mailing list