From: Changyeon Lee Date: Thu, 19 Sep 2019 05:35:21 +0000 (+0900) Subject: e_hwc_window: check notify when remove destroy listener X-Git-Tag: submit/tizen/20190919.071917^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ec9a3156ee61be85794c9ce53d22a22fb7e82ed;p=platform%2Fupstream%2Fenlightenment.git e_hwc_window: check notify when remove destroy listener Change-Id: I85d0aef0a7e69a5bf381b4d401e8a766adc64a1a --- diff --git a/src/bin/e_hwc_window.c b/src/bin/e_hwc_window.c index a0e82ed..5f1f53e 100644 --- a/src/bin/e_hwc_window.c +++ b/src/bin/e_hwc_window.c @@ -256,8 +256,11 @@ _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); + if (window_buffer->queue_destroy_listener.notify) + { + wl_list_remove(&window_buffer->queue_destroy_listener.link); + window_buffer->queue_destroy_listener.notify = NULL; + } window_buffer->queue = NULL; } @@ -269,8 +272,11 @@ _e_hwc_window_buffer_set(E_Hwc_Window_Buffer *window_buffer, { if (window_buffer->queue != queue) { - if (window_buffer->queue) - wl_list_remove(&window_buffer->queue_destroy_listener.link); + if (window_buffer->queue_destroy_listener.notify) + { + wl_list_remove(&window_buffer->queue_destroy_listener.link); + window_buffer->queue_destroy_listener.notify = NULL; + } if (queue) { @@ -298,8 +304,11 @@ _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); + if (hwc_window->queue_destroy_listener.notify) + { + wl_list_remove(&hwc_window->queue_destroy_listener.link); + hwc_window->queue_destroy_listener.notify = NULL; + } hwc_window->queue = NULL; hwc_window->constraints &= ~TDM_HWC_WIN_CONSTRAINT_BUFFER_QUEUE; @@ -322,8 +331,11 @@ _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); + if (hwc_window->queue_destroy_listener.notify) + { + wl_list_remove(&hwc_window->queue_destroy_listener.link); + hwc_window->queue_destroy_listener.notify = NULL; + } wl_signal_add(&queue->destroy_signal, &hwc_window->queue_destroy_listener); hwc_window->queue_destroy_listener.notify = _e_hwc_window_cb_queue_destroy; @@ -342,7 +354,13 @@ _e_hwc_window_buffer_queue_unset(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); + + if (hwc_window->queue_destroy_listener.notify) + { + wl_list_remove(&hwc_window->queue_destroy_listener.link); + hwc_window->queue_destroy_listener.notify = NULL; + } + hwc_window->queue = NULL; } @@ -476,8 +494,11 @@ _e_hwc_window_cb_cursor_buffer_destroy(struct wl_listener *listener, void *data) if ((E_Comp_Wl_Buffer *)data != hwc_window->cursor.buffer) return; - if (hwc_window->cursor.buffer) - wl_list_remove(&hwc_window->cursor_buffer_destroy_listener.link); + if (hwc_window->cursor_buffer_destroy_listener.notify) + { + wl_list_remove(&hwc_window->cursor_buffer_destroy_listener.link); + hwc_window->cursor_buffer_destroy_listener.notify = NULL; + } hwc_window->cursor.buffer = NULL; } @@ -505,8 +526,11 @@ _e_hwc_window_cursor_image_update(E_Hwc_Window *hwc_window) return EINA_FALSE; } - if (hwc_window->cursor.buffer) - wl_list_remove(&hwc_window->cursor_buffer_destroy_listener.link); + if (hwc_window->cursor_buffer_destroy_listener.notify) + { + wl_list_remove(&hwc_window->cursor_buffer_destroy_listener.link); + hwc_window->cursor_buffer_destroy_listener.notify = NULL; + } hwc_window->cursor.buffer = NULL; hwc_window->cursor.rotation = 0; @@ -552,8 +576,11 @@ _e_hwc_window_cursor_image_update(E_Hwc_Window *hwc_window) return EINA_FALSE; } - if (hwc_window->cursor.buffer) - wl_list_remove(&hwc_window->cursor_buffer_destroy_listener.link); + if (hwc_window->cursor_buffer_destroy_listener.notify) + { + wl_list_remove(&hwc_window->cursor_buffer_destroy_listener.link); + hwc_window->cursor_buffer_destroy_listener.notify = NULL; + } hwc_window->cursor.buffer = buffer; wl_signal_add(&buffer->destroy_signal, &hwc_window->cursor_buffer_destroy_listener); @@ -662,17 +689,29 @@ _e_hwc_window_free(E_Hwc_Window *hwc_window) EHWINF("Free", NULL, hwc_window->hwc, hwc_window); done: - if (hwc_window->cursor.buffer) - wl_list_remove(&hwc_window->cursor_buffer_destroy_listener.link); + if (hwc_window->cursor_buffer_destroy_listener.notify) + { + wl_list_remove(&hwc_window->cursor_buffer_destroy_listener.link); + hwc_window->cursor_buffer_destroy_listener.notify = NULL; + } - if (hwc_window->queue) - wl_list_remove(&hwc_window->queue_destroy_listener.link); + if (hwc_window->queue_destroy_listener.notify) + { + wl_list_remove(&hwc_window->queue_destroy_listener.link); + hwc_window->queue_destroy_listener.notify = NULL; + } - if (hwc_window->buffer.queue) - wl_list_remove(&hwc_window->buffer.queue_destroy_listener.link); + if (hwc_window->buffer.queue_destroy_listener.notify) + { + wl_list_remove(&hwc_window->buffer.queue_destroy_listener.link); + hwc_window->buffer.queue_destroy_listener.notify = NULL; + } - if (hwc_window->display.buffer.queue) - wl_list_remove(&hwc_window->display.buffer.queue_destroy_listener.link); + if (hwc_window->display.buffer.queue_destroy_listener.notify) + { + wl_list_remove(&hwc_window->display.buffer.queue_destroy_listener.link); + hwc_window->display.buffer.queue_destroy_listener.notify = NULL; + } E_FREE(hwc_window); } @@ -741,7 +780,12 @@ e_hwc_window_free(E_Hwc_Window *hwc_window) { e_hwc_window_queue_user_unset(hwc_window->queue, hwc_window); - wl_list_remove(&hwc_window->queue_destroy_listener.link); + if (hwc_window->queue_destroy_listener.notify) + { + wl_list_remove(&hwc_window->queue_destroy_listener.link); + hwc_window->queue_destroy_listener.notify = NULL; + } + hwc_window->queue = NULL; }