efreet: avoid crash during shutdown due to Ecore_Event queue.
authorCedric BAIL <cedric@osg.samsung.com>
Fri, 10 Mar 2017 00:16:28 +0000 (16:16 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Fri, 10 Mar 2017 00:17:58 +0000 (16:17 -0800)
src/lib/efreet/efreet_cache.c

index 82ceaca..a9d5bec 100644 (file)
@@ -274,9 +274,12 @@ efreet_cache_init(void)
         ERR("Failed to create directory '%s'", buf);
     }
 
-    EFREET_EVENT_ICON_CACHE_UPDATE = ecore_event_type_new();
-    EFREET_EVENT_DESKTOP_CACHE_UPDATE = ecore_event_type_new();
-    EFREET_EVENT_DESKTOP_CACHE_BUILD = ecore_event_type_new();
+    if (EFREET_EVENT_ICON_CACHE_UPDATE == 0)
+      {
+         EFREET_EVENT_ICON_CACHE_UPDATE = ecore_event_type_new();
+         EFREET_EVENT_DESKTOP_CACHE_UPDATE = ecore_event_type_new();
+         EFREET_EVENT_DESKTOP_CACHE_BUILD = ecore_event_type_new();
+      }
 
     themes = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_theme_free));
     icons = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_free));
@@ -342,6 +345,10 @@ efreet_cache_shutdown(void)
 {
     Efreet_Old_Cache *d;
 
+    ecore_event_type_flush(EFREET_EVENT_ICON_CACHE_UPDATE,
+                           EFREET_EVENT_DESKTOP_CACHE_UPDATE,
+                           EFREET_EVENT_DESKTOP_CACHE_BUILD);
+
     IF_RELEASE(theme_name);
 
     icon_cache = efreet_cache_close(icon_cache);