mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 18:52:09 +01:00
GWin32RegistryKey: ensure reqeueing works correctly
If a key watch is renewed from the key watch callback, it results in the callback being NULL, since we clear it after we call it. Rearrange the function to make sure that the changes done by the callback function are preserved properly.
This commit is contained in:
parent
d6a734a44c
commit
22e5e428de
@ -2425,17 +2425,20 @@ key_changed (PVOID closure,
|
||||
ULONG reserved)
|
||||
{
|
||||
GWin32RegistryKey *key = G_WIN32_REGISTRY_KEY (closure);
|
||||
gpointer user_data;
|
||||
GWin32RegistryKeyWatchCallbackFunc callback;
|
||||
|
||||
callback = g_steal_pointer (&key->priv->callback);
|
||||
user_data = g_steal_pointer (&key->priv->user_data);
|
||||
|
||||
g_free (status_block);
|
||||
g_atomic_int_set (&key->priv->change_indicator, G_WIN32_KEY_CHANGED);
|
||||
g_atomic_int_set (&key->priv->watch_indicator, G_WIN32_KEY_UNWATCHED);
|
||||
key->priv->update_flags = G_WIN32_REGISTRY_UPDATED_NOTHING;
|
||||
|
||||
if (key->priv->callback)
|
||||
key->priv->callback (key, key->priv->user_data);
|
||||
if (callback)
|
||||
callback (key, user_data);
|
||||
|
||||
key->priv->callback = NULL;
|
||||
key->priv->user_data = NULL;
|
||||
g_object_unref (key);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user