[gimp] Bug 599797 - Crash on "Refresh dynamics" if ~/.gimp-2.7/dynamics folder is missing



commit cfa76869d69f3c4e8ad5de87d264978063152337
Author: Michael Natterer <mitch gimp org>
Date:   Fri Oct 30 22:58:19 2009 +0100

    Bug 599797 - Crash on "Refresh dynamics" if ~/.gimp-2.7/dynamics folder is missing
    
    (gimp_data_factory_refresh_cache_add): don't add data objects without
    filename to the refresh cache. Regardless why they have no filename,
    they can't be reloaded anyway (in this case it's newly created objects
    that couldn't be saved because there is no folder to save them).

 app/core/gimpdatafactory.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/app/core/gimpdatafactory.c b/app/core/gimpdatafactory.c
index 03cd96a..ae0d3d8 100644
--- a/app/core/gimpdatafactory.c
+++ b/app/core/gimpdatafactory.c
@@ -244,17 +244,20 @@ gimp_data_factory_refresh_cache_add (GimpDataFactory *factory,
                                      GimpData        *data,
                                      gpointer         user_data)
 {
-  GHashTable *cache = user_data;
-  GList      *list;
+  if (data->filename)
+    {
+      GHashTable *cache = user_data;
+      GList      *list;
 
-  g_object_ref (data);
+      g_object_ref (data);
 
-  gimp_container_remove (factory->priv->container, GIMP_OBJECT (data));
+      gimp_container_remove (factory->priv->container, GIMP_OBJECT (data));
 
-  list = g_hash_table_lookup (cache, data->filename);
-  list = g_list_prepend (list, data);
+      list = g_hash_table_lookup (cache, data->filename);
+      list = g_list_prepend (list, data);
 
-  g_hash_table_insert (cache, (gpointer) data->filename, list);
+      g_hash_table_insert (cache, (gpointer) data->filename, list);
+    }
 }
 
 static gboolean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]