diff options
author | Ryan Lortie <desrt@desrt.ca> | 2010-05-16 12:55:41 +0200 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2010-05-18 16:21:48 -0400 |
commit | f8a175da7968e099a3b7805a0f89d9d78245b12e (patch) | |
tree | 79a2b321c126af3e4ec0e1267a7f42978f6a44b9 /gsettings | |
parent | f00325615d2945e24b6d6de90ef7fcff3823bd9e (diff) | |
download | dconf-f8a175da7968e099a3b7805a0f89d9d78245b12e.tar.gz |
Fix some deadlocks (missed free due to early exit)
Diffstat (limited to 'gsettings')
-rw-r--r-- | gsettings/dconfdatabase.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gsettings/dconfdatabase.c b/gsettings/dconfdatabase.c index 01f983b..0dd2b90 100644 --- a/gsettings/dconfdatabase.c +++ b/gsettings/dconfdatabase.c @@ -70,7 +70,7 @@ dconf_database_new_outstanding (DConfDatabase *database, outstanding->set_key = g_strdup (set_key); if (set_value) - outstanding->set_value = g_variant_ref (set_value); + outstanding->set_value = g_variant_ref_sink (set_value); else outstanding->set_value = NULL; @@ -92,6 +92,7 @@ dconf_database_remove_outstanding (DConfDatabase *database, GDBusMessage *message, guint64 *anti_expose) { + gboolean found = FALSE; Outstanding **node; guint32 serial; @@ -132,12 +133,13 @@ dconf_database_remove_outstanding (DConfDatabase *database, if (tmp->tree) g_tree_unref (tmp->tree); - return TRUE; + found = TRUE; + break; } g_static_mutex_unlock (&database->lock); - return FALSE; + return found; } static gboolean @@ -168,6 +170,7 @@ dconf_database_scan_outstanding (DConfDatabase *database, const gchar *key, GVariant **value) { + gboolean found = FALSE; Outstanding *node; gsize length; @@ -185,7 +188,8 @@ dconf_database_scan_outstanding (DConfDatabase *database, if (g_str_has_prefix (key, node->reset_path)) { *value = NULL; - return TRUE; + found = TRUE; + break; } } @@ -194,11 +198,12 @@ dconf_database_scan_outstanding (DConfDatabase *database, if (strcmp (key, node->set_key) == 0) { if (node->set_value != NULL) - *value = g_variant_ref (*value); + *value = g_variant_ref (node->set_value); else *value = NULL; - return TRUE; + found = TRUE; + break; } } @@ -214,14 +219,15 @@ dconf_database_scan_outstanding (DConfDatabase *database, else *value = NULL; - return TRUE; + found = TRUE; + break; } } } g_static_mutex_unlock (&database->lock); - return FALSE; + return found; } static void |