diff options
author | Ryan Lortie <desrt@desrt.ca> | 2012-07-12 01:30:06 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2012-07-12 01:30:06 -0400 |
commit | cd27413d87009d9d452c54b1b5bd65a9a5581ded (patch) | |
tree | 6c1f9b338b172c4a753b64afabc62475255f95a8 | |
parent | 77475dc9fab10dc60f1b87382f41e79b277e8b97 (diff) | |
download | dconf-cd27413d87009d9d452c54b1b5bd65a9a5581ded.tar.gz |
engine/: fix refcounting error
The new supposedly-threadsafe implementation of refcounting in the
engine still had a bug in it: in the event that we were going to remove
the last reference and we discovered that the refcount was not 1 after
taking the lock, we would return (under the assumption that someone else
had increased the count).
This is the wrong thing to do. No matter what, we need to drop our
reference -- instead of return, we should goto again.
-rw-r--r-- | engine/dconf-engine.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c index 2edbb50..e182e8f 100644 --- a/engine/dconf-engine.c +++ b/engine/dconf-engine.c @@ -274,7 +274,7 @@ dconf_engine_unref (DConfEngine *engine) if (engine->ref_count != 1) { g_mutex_unlock (&dconf_engine_global_lock); - return; + goto again; } dconf_engine_global_list = g_slist_remove (dconf_engine_global_list, engine); g_mutex_unlock (&dconf_engine_global_lock); |