On Fri, Nov 23, 2012 at 4:30 PM, Christopher Michael <[email protected]> wrote: > Enlightenment SVN <[email protected]> wrote: > >>Log: >>Don't leak struct wl_registry >> >> Signed-off-by: Eduardo Lima (Etrunko) <[email protected]> >> >> >> >>Author: etrunko >>Date: 2012-11-23 09:49:39 -0800 (Fri, 23 Nov 2012) >>New Revision: 79565 >>Trac: http://trac.enlightenment.org/e/changeset/79565 >> >>Modified: >>trunk/expedite/src/bin/engine_wayland_egl.c >>trunk/expedite/src/bin/engine_wayland_shm.c >> >>Modified: trunk/expedite/src/bin/engine_wayland_egl.c >>=================================================================== >>--- trunk/expedite/src/bin/engine_wayland_egl.c 2012-11-23 17:19:42 UTC >>(rev 79564) >>+++ trunk/expedite/src/bin/engine_wayland_egl.c 2012-11-23 17:49:39 UTC >>(rev 79565) >>@@ -8,10 +8,13 @@ >> #include <wayland-client.h> >> #include <wayland-egl.h> >> >>-/* Global struct */ >>+/* >>+ * Global struct >>+ */ >> struct _engine_wayland_egl_display >> { >> struct wl_display *display; >>+ struct wl_registry *registry; >> struct wl_compositor *compositor; >> struct wl_surface *surface; >> struct wl_shell *shell; >>@@ -21,7 +24,7 @@ >> static struct _engine_wayland_egl_display wl; >> >> /* >>- * Function prototypes >>+ * Function Prototypes >> */ >> /* Registry handler */ >>static void _registry_handle_global(void *data, struct wl_registry >>*registry, unsigned int id, const char *interface, unsigned int >>version __UNUSED__); >>@@ -37,7 +40,6 @@ >> Eina_Bool >>engine_wayland_egl_args(const char *engine __UNUSED__, int width >>__UNUSED__, int height __UNUSED__) >> { >>- struct wl_registry *registry; >> Evas_Engine_Info_Wayland_Egl *einfo; >> >>evas_output_method_set(evas, evas_render_method_lookup("wayland_egl")); >>@@ -49,8 +51,8 @@ >> } >> >> wl.display = wl_display_connect(NULL); >>- registry = wl_display_get_registry(wl.display); >>- wl_registry_add_listener(registry, &_registry_listener, NULL); >>+ wl.registry = wl_display_get_registry(wl.display); >>+ wl_registry_add_listener(wl.registry, &_registry_listener, NULL); >> wl_display_roundtrip(wl.display); >> >> assert(wl.compositor != NULL); >>@@ -83,6 +85,7 @@ >> wl_surface_destroy(wl.surface); >> wl_shell_destroy(wl.shell); >> wl_compositor_destroy(wl.compositor); >>+ wl_registry_destroy(wl.registry); >> wl_display_flush(wl.display); >> wl_display_disconnect(wl.display); >> } >> >>Modified: trunk/expedite/src/bin/engine_wayland_shm.c >>=================================================================== >>--- trunk/expedite/src/bin/engine_wayland_shm.c 2012-11-23 17:19:42 UTC >>(rev 79564) >>+++ trunk/expedite/src/bin/engine_wayland_shm.c 2012-11-23 17:49:39 UTC >>(rev 79565) >>@@ -15,6 +15,7 @@ >> struct _engine_wayland_shm_display >> { >> struct wl_display *display; >>+ struct wl_registry *registry; >> struct wl_compositor *compositor; >> struct wl_surface *surface; >> struct wl_callback *frame_callback; >>@@ -56,7 +57,6 @@ >> Eina_Bool >>engine_wayland_shm_args(const char *engine __UNUSED__, int width, int >>height) >> { >>- struct wl_registry *registry; >> Evas_Engine_Info_Wayland_Shm *einfo; >> >>evas_output_method_set(evas, evas_render_method_lookup("wayland_shm")); >>@@ -68,8 +68,8 @@ >> } >> >> wl.display = wl_display_connect(NULL); >>- registry = wl_display_get_registry(wl.display); >>- wl_registry_add_listener(registry, &_registry_listener, NULL); >>+ wl.registry = wl_display_get_registry(wl.display); >>+ wl_registry_add_listener(wl.registry, &_registry_listener, NULL); >> wl_display_roundtrip(wl.display); >> >> assert(wl.compositor != NULL); >>@@ -120,6 +120,7 @@ >> wl_shm_destroy(wl.shm); >> wl_shell_destroy(wl.shell); >> wl_compositor_destroy(wl.compositor); >>+ wl_registry_destroy(wl.registry); >> wl_display_flush(wl.display); >> wl_display_disconnect(wl.display); >> } >>@@ -134,10 +135,10 @@ >>wl.compositor = wl_registry_bind(registry, id, >>&wl_compositor_interface, 1); >> else if (!strcmp(interface, "wl_shell")) >> wl.shell = wl_registry_bind(registry, id, &wl_shell_interface, 1); >>+ else if (!strcmp(interface, "wl_seat")) >>+ engine_wayland_register_seat(registry, id); >> else if (!strcmp(interface, "wl_shm")) >> wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); >>- else if (!strcmp(interface, "wl_seat")) >>- engine_wayland_register_seat(registry, id); >> } >> >> static void >> >> >>------------------------------------------------------------------------------ >>Monitor your physical, virtual and cloud infrastructure from a single >>web console. Get in-depth insight into apps, servers, databases, >>vmware, >>SAP, cloud infrastructure, etc. Download 30-day Free Trial. >>Pricing starts from $795 for 25 servers or applications! >>http://p.sf.net/sfu/zoho_dev2dev_nov >>_______________________________________________ >>enlightenment-svn mailing list >>[email protected] >>https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > > Nice one !! Good catch ;) >
Yeah, I have just ported it to ecore too. :) -- Eduardo de Barros Lima ◤✠◢ [email protected] ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
