mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
registrybackend: do not leak key and event if it cannot add the watch
This commit is contained in:
parent
a92d97ff1f
commit
31aab1bd42
@ -1933,7 +1933,11 @@ g_registry_backend_subscribe (GSettingsBackend *backend,
|
||||
/* The actual watch is added by the thread, which has to re-subscribe each time it
|
||||
* receives a change. */
|
||||
if (!watch_add_notify (self, event, hpath, g_strdup (key_name)))
|
||||
g_atomic_int_inc (&self->watch->watches_remaining);
|
||||
{
|
||||
g_atomic_int_inc (&self->watch->watches_remaining);
|
||||
RegCloseKey (hpath);
|
||||
CloseHandle (event);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user