hey.. if we use magic poinrters like... -1 for not existing... null
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 20 Aug 2011 04:22:24 +0000 (04:22 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 20 Aug 2011 04:22:24 +0000 (04:22 +0000)
would probably be fine though here)... we should always then handle
all the cases correctly! fix segv in efreet shutdown

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@62616 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/efreet_cache.c

index a476294..fb577ad 100644 (file)
@@ -232,7 +232,7 @@ efreet_cache_shutdown(void)
     }
 
     if (old_desktop_caches)
-        WRN("This application has not properly closed all its desktop references!");
+        ERR("This application has not properly closed all its desktop references!");
     EINA_LIST_FREE(old_desktop_caches, d)
     {
         eina_hash_free(d->hash);
@@ -1121,15 +1121,18 @@ cache_update_cb(void *data __UNUSED__, Ecore_File_Monitor *em __UNUSED__,
             IF_RELEASE(util_cache_names_key);
             IF_RELEASE(util_cache_hash_key);
 
-            d = NEW(Efreet_Old_Cache, 1);
-            if (!d) goto error;
-            d->hash = desktops;
-            d->ef = desktop_cache;
-            old_desktop_caches = eina_list_append(old_desktop_caches, d);
-
-            desktops = eina_hash_string_superfast_new(NULL);
-            desktop_cache = NULL;
-
+            if ((desktop_cache) && (desktop_cache != NON_EXISTING))
+            {
+                d = NEW(Efreet_Old_Cache, 1);
+                if (!d) goto error;
+                d->hash = desktops;
+                d->ef = desktop_cache;
+                old_desktop_caches = eina_list_append(old_desktop_caches, d);
+                
+                desktops = eina_hash_string_superfast_new(NULL);
+                desktop_cache = NULL;
+            }
+            
             efreet_cache_array_string_free(util_cache_names);
             util_cache_names = NULL;