[Xfce4-commits] r30419 - xfconf/trunk/xfconf

Brian Tarricone kelnos at xfce.org
Thu Jul 30 00:10:52 CEST 2009


Author: kelnos
Date: 2009-07-29 22:10:52 +0000 (Wed, 29 Jul 2009)
New Revision: 30419

Modified:
   xfconf/trunk/xfconf/xfconf-cache.c
Log:
fix a possible reentrancy issue.

a client could re-enter the set function when handling the signal
that reverts a property value after an error.  if the old_item is
still in one of the hash tables, that could confuse things.

Modified: xfconf/trunk/xfconf/xfconf-cache.c
===================================================================
--- xfconf/trunk/xfconf/xfconf-cache.c	2009-07-29 21:43:07 UTC (rev 30418)
+++ xfconf/trunk/xfconf/xfconf-cache.c	2009-07-29 22:10:52 UTC (rev 30419)
@@ -466,6 +466,10 @@
         g_critical("Couldn't find current cache item based on pending call (libxfconf bug?)");
         goto out;
     }
+
+    g_hash_table_remove(cache->old_properties, old_item->property);
+    /* don't destroy old_item yet */
+    g_hash_table_steal(cache->pending_calls, old_item->call);
     
     /* NULL this out so we don't try to cancel it in the remove function */
     old_item->call = NULL;
@@ -495,10 +499,8 @@
     }
 
 out:
-    if(old_item) {
-        g_hash_table_remove(cache->old_properties, old_item->property);
-        g_hash_table_remove(cache->pending_calls, old_item->call);
-    }
+    if(old_item)
+        xfconf_cache_old_item_free(old_item);
 
     xfconf_cache_mutex_unlock(&cache->cache_lock);
 }




More information about the Xfce4-commits mailing list