summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Tarricone <brian@tarricone.org>2009-07-29 22:10:52 +0000
committerBrian Tarricone <brian@tarricone.org>2009-07-29 22:10:52 +0000
commitfb1ed1eb59b71e1a73d5e224a2a5e876d1c92512 (patch)
treeed3acc69d57e12a3916c4e9b058da58ff28c1fe3
parentc62009f0861f2d5f36498f33eaa504eb74a57913 (diff)
downloadxfconf-fb1ed1eb59b71e1a73d5e224a2a5e876d1c92512.tar.gz
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. (Old svn revision: 30419)
-rw-r--r--xfconf/xfconf-cache.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/xfconf/xfconf-cache.c b/xfconf/xfconf-cache.c
index 0bbdd05..ec1e0c6 100644
--- a/xfconf/xfconf-cache.c
+++ b/xfconf/xfconf-cache.c
@@ -466,6 +466,10 @@ xfconf_cache_set_property_reply_handler(DBusGProxy *proxy,
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 @@ xfconf_cache_set_property_reply_handler(DBusGProxy *proxy,
}
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);
}