e_comp_wl: remove the destroy_listener link of the e_comp_wl_buffer 79/143379/3
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 9 Aug 2017 09:00:11 +0000 (18:00 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 10 Aug 2017 00:49:32 +0000 (00:49 +0000)
if not destroying, memory can be broken at the time of
calling the signal_emit of the destroy_listener in the
libwayland-server library.

Change-Id: I3e9368b060dcedc53697a60650eac09677829d60

src/bin/e_comp_wl.c

index aecb8458e9c98596d33d5296eb9fa838bd4249fb..fc6bf43eb58cd055149e3b2e3b3051fc8712b83a 100644 (file)
@@ -1853,6 +1853,13 @@ _e_comp_wl_buffer_cb_destroy(struct wl_listener *listener, void *data EINA_UNUSE
    eina_stringshare_del(buffer->debug_info.owner_name);
 
    wl_signal_emit(&buffer->destroy_signal, buffer);
+
+   if (buffer->destroy_listener.notify)
+     {
+        wl_list_remove(&buffer->destroy_listener.link);
+        buffer->destroy_listener.notify = NULL;
+     }
+
    free(buffer);
 }