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).
This commit is contained in:
Michael Natterer 2009-10-30 22:58:19 +01:00
parent 223cbeb6fb
commit cfa76869d6
1 changed files with 10 additions and 7 deletions

View File

@ -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