mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
improve thread safety in GDelayedSettingsBackend
- hold a lock while accessing the tree of delayed values - use weak reference counts with the owner object to avoid doing g_object_notify on a dead object - dispatch the "has-unapplied" notify to the proper main context
This commit is contained in:
@@ -126,7 +126,7 @@ is_path (const gchar *path)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GMainContext *
|
||||
GMainContext *
|
||||
g_settings_backend_get_active_context (void)
|
||||
{
|
||||
GMainContext *context;
|
||||
@@ -177,7 +177,7 @@ struct _GSettingsBackendClosure
|
||||
|
||||
static void
|
||||
g_settings_backend_watch_weak_notify (gpointer data,
|
||||
GObject *where_object_was)
|
||||
GObject *where_the_object_was)
|
||||
{
|
||||
GSettingsBackend *backend = data;
|
||||
GSettingsBackendWatch **ptr;
|
||||
@@ -185,7 +185,7 @@ g_settings_backend_watch_weak_notify (gpointer data,
|
||||
/* search and remove */
|
||||
g_static_mutex_lock (&backend->priv->lock);
|
||||
for (ptr = &backend->priv->watches; *ptr; ptr = &(*ptr)->next)
|
||||
if ((*ptr)->target == where_object_was)
|
||||
if ((*ptr)->target == where_the_object_was)
|
||||
{
|
||||
GSettingsBackendWatch *tmp = *ptr;
|
||||
|
||||
|
Reference in New Issue
Block a user