e_hwc_window: remove destroy listener before resource is unset 10/213910/3
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 16 Sep 2019 09:49:40 +0000 (18:49 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Tue, 17 Sep 2019 05:02:14 +0000 (05:02 +0000)
Change-Id: Ia84bc72e3872db2f3c0d0392851db3fc87058209

src/bin/e_hwc_window.c

index 83aa0a791ac6c55961f6d804863bd099c72e0271..a0e82ede5539334fb64fea09202f36bc68d0a641 100644 (file)
@@ -256,6 +256,9 @@ _e_hwc_window_buffer_cb_queue_destroy(struct wl_listener *listener, void *data)
 
    if ((E_Hwc_Window_Queue *)data != window_buffer->queue) return;
 
+   if (window_buffer->queue)
+     wl_list_remove(&window_buffer->queue_destroy_listener.link);
+
    window_buffer->queue = NULL;
 }
 
@@ -295,6 +298,9 @@ _e_hwc_window_cb_queue_destroy(struct wl_listener *listener, void *data)
 
    if ((E_Hwc_Window_Queue *)data != hwc_window->queue) return;
 
+   if (hwc_window->queue)
+     wl_list_remove(&hwc_window->queue_destroy_listener.link);
+
    hwc_window->queue = NULL;
    hwc_window->constraints &= ~TDM_HWC_WIN_CONSTRAINT_BUFFER_QUEUE;
 }
@@ -316,6 +322,9 @@ _e_hwc_window_buffer_queue_set(E_Hwc_Window *hwc_window)
          return EINA_FALSE;
      }
 
+   if (hwc_window->queue)
+     wl_list_remove(&hwc_window->queue_destroy_listener.link);
+
    wl_signal_add(&queue->destroy_signal, &hwc_window->queue_destroy_listener);
    hwc_window->queue_destroy_listener.notify = _e_hwc_window_cb_queue_destroy;
    hwc_window->queue = queue;
@@ -731,6 +740,8 @@ e_hwc_window_free(E_Hwc_Window *hwc_window)
    if (hwc_window->queue)
      {
         e_hwc_window_queue_user_unset(hwc_window->queue, hwc_window);
+
+        wl_list_remove(&hwc_window->queue_destroy_listener.link);
         hwc_window->queue = NULL;
      }