From: Cedric BAIL Date: Fri, 10 Mar 2017 00:13:13 +0000 (-0800) Subject: ecore_psl1ght: avoid crash during shutdown due to Ecore_Event queue. X-Git-Tag: upstream/1.20.0~1748 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7d8f7bdd3ce16dfc08d54b9edfee66fc34c87c0;p=platform%2Fupstream%2Fefl.git ecore_psl1ght: avoid crash during shutdown due to Ecore_Event queue. --- diff --git a/src/lib/ecore_psl1ght/ecore_psl1ght.c b/src/lib/ecore_psl1ght/ecore_psl1ght.c index adc0595..1a16145 100644 --- a/src/lib/ecore_psl1ght/ecore_psl1ght.c +++ b/src/lib/ecore_psl1ght/ecore_psl1ght.c @@ -147,11 +147,14 @@ ecore_psl1ght_init(const char *name EINA_UNUSED) sysUtilRegisterCallback (SYSUTIL_EVENT_SLOT0, xmb_event_handler, NULL); - ECORE_PSL1GHT_EVENT_GOT_FOCUS = ecore_event_type_new(); - ECORE_PSL1GHT_EVENT_LOST_FOCUS = ecore_event_type_new(); - ECORE_PSL1GHT_EVENT_EXPOSE = ecore_event_type_new(); - ECORE_PSL1GHT_EVENT_KEY_MODIFIERS = ecore_event_type_new(); - ECORE_PSL1GHT_EVENT_QUIT = ecore_event_type_new(); + if (ECORE_PSL1GHT_EVENT_GOT_FOCUS == 0) + { + ECORE_PSL1GHT_EVENT_GOT_FOCUS = ecore_event_type_new(); + ECORE_PSL1GHT_EVENT_LOST_FOCUS = ecore_event_type_new(); + ECORE_PSL1GHT_EVENT_EXPOSE = ecore_event_type_new(); + ECORE_PSL1GHT_EVENT_KEY_MODIFIERS = ecore_event_type_new(); + ECORE_PSL1GHT_EVENT_QUIT = ecore_event_type_new(); + } mouse_x = 0; mouse_y = 0; @@ -175,11 +178,11 @@ ecore_psl1ght_shutdown(void) eina_log_domain_unregister(_ecore_psl1ght_log_dom); _ecore_psl1ght_log_dom = -1; - ECORE_PSL1GHT_EVENT_GOT_FOCUS = 0; - ECORE_PSL1GHT_EVENT_LOST_FOCUS = 0; - ECORE_PSL1GHT_EVENT_EXPOSE = 0; - ECORE_PSL1GHT_EVENT_KEY_MODIFIERS = 0; - ECORE_PSL1GHT_EVENT_QUIT = 0; + ecore_event_type_flush(ECORE_PSL1GHT_EVENT_GOT_FOCUS, + ECORE_PSL1GHT_EVENT_LOST_FOCUS, + ECORE_PSL1GHT_EVENT_EXPOSE, + ECORE_PSL1GHT_EVENT_KEY_MODIFIERS, + ECORE_PSL1GHT_EVENT_QUIT); ioPadEnd(); ioMouseEnd();