mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
registrybackend: use ptr_array_new_with_free_func
This commit is contained in:
parent
9098a7f927
commit
bf3f827ca1
@ -1392,10 +1392,7 @@ watch_handler (RegistryEvent *event)
|
|||||||
g_settings_backend_keys_changed (G_SETTINGS_BACKEND (event->self), event->prefix,
|
g_settings_backend_keys_changed (G_SETTINGS_BACKEND (event->self), event->prefix,
|
||||||
(gchar const **)event->items->pdata, NULL);
|
(gchar const **)event->items->pdata, NULL);
|
||||||
|
|
||||||
for (i = 0; i < event->items->len; i++)
|
|
||||||
g_free (g_ptr_array_index (event->items, i));
|
|
||||||
g_ptr_array_free (event->items, TRUE);
|
g_ptr_array_free (event->items, TRUE);
|
||||||
|
|
||||||
g_free (event->prefix);
|
g_free (event->prefix);
|
||||||
g_object_unref (event->self);
|
g_object_unref (event->self);
|
||||||
g_slice_free (RegistryEvent, event);
|
g_slice_free (RegistryEvent, event);
|
||||||
@ -1654,7 +1651,7 @@ watch_thread_function (LPVOID parameter)
|
|||||||
event->self = G_REGISTRY_BACKEND (self->owner);
|
event->self = G_REGISTRY_BACKEND (self->owner);
|
||||||
g_object_ref (self->owner);
|
g_object_ref (self->owner);
|
||||||
|
|
||||||
event->items = g_ptr_array_new ();
|
event->items = g_ptr_array_new_with_free_func (g_free);
|
||||||
|
|
||||||
EnterCriticalSection (G_REGISTRY_BACKEND (self->owner)->cache_lock);
|
EnterCriticalSection (G_REGISTRY_BACKEND (self->owner)->cache_lock);
|
||||||
registry_cache_update (G_REGISTRY_BACKEND (self->owner), hpath,
|
registry_cache_update (G_REGISTRY_BACKEND (self->owner), hpath,
|
||||||
|
Loading…
Reference in New Issue
Block a user