From b7d8f7bdd3ce16dfc08d54b9edfee66fc34c87c0 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Thu, 9 Mar 2017 16:13:13 -0800 Subject: [PATCH] ecore_psl1ght: avoid crash during shutdown due to Ecore_Event queue. --- src/lib/ecore_psl1ght/ecore_psl1ght.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) 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(); -- 2.7.4