[dconf/wip/reorg] engine/: fix refcounting error



commit cd27413d87009d9d452c54b1b5bd65a9a5581ded
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Jul 12 01:30:06 2012 -0400

    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.

 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);



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