[PATCH weston 1/2] clients: destroy wl_registry on exit

Pekka Paalanen ppaalanen at gmail.com
Tue Dec 4 06:01:15 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 20d09d5..c7767ae 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -4314,6 +4314,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