Ensure critial sections are released before returning

https://bugzilla.gnome.org/show_bug.cgi?id=734035
This commit is contained in:
Руслан Ижбулатов 2014-07-31 10:12:59 +00:00
parent ad4f784656
commit 905a8e655c

View File

@ -1754,8 +1754,12 @@ watch_add_notify (GRegistryBackend *self,
EnterCriticalSection (self->cache_lock); EnterCriticalSection (self->cache_lock);
cache_node = registry_cache_get_node_for_key (self->cache_root, gsettings_prefix, TRUE); cache_node = registry_cache_get_node_for_key (self->cache_root, gsettings_prefix, TRUE);
g_return_val_if_fail (cache_node != NULL, FALSE); if (cache_node == NULL || cache_node->data == NULL)
g_return_val_if_fail (cache_node->data != NULL, FALSE); {
LeaveCriticalSection (self->cache_lock);
g_warn_if_reached ();
return FALSE;
}
cache_item = cache_node->data; cache_item = cache_node->data;
@ -1764,6 +1768,7 @@ watch_add_notify (GRegistryBackend *self,
{ {
trace ("watch_add_notify: prefix %s already watched, %i subscribers.\n", trace ("watch_add_notify: prefix %s already watched, %i subscribers.\n",
gsettings_prefix, cache_item->subscription_count); gsettings_prefix, cache_item->subscription_count);
LeaveCriticalSection (self->cache_lock);
return FALSE; return FALSE;
} }