mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 18:52:09 +01:00
Take a reference on the gio file monitors while signaling pending file changes
It was possible for a signal handler to remove the last reference and dispose the monitor. If there were remaining pending_file_changes they tried to dereference the disposed monitor. This patch simply calls g_object_{ref,unref} around the loop that signals the changes.
This commit is contained in:
parent
eb6c59bc48
commit
c2ed17a1a7
@ -364,6 +364,7 @@ emit_cb (gpointer data)
|
|||||||
monitor->priv->pending_file_changes = NULL;
|
monitor->priv->pending_file_changes = NULL;
|
||||||
monitor->priv->pending_file_change_id = 0;
|
monitor->priv->pending_file_change_id = 0;
|
||||||
|
|
||||||
|
g_object_ref (monitor);
|
||||||
for (iter = pending; iter; iter = iter->next)
|
for (iter = pending; iter; iter = iter->next)
|
||||||
{
|
{
|
||||||
FileChange *change = iter->data;
|
FileChange *change = iter->data;
|
||||||
@ -372,6 +373,8 @@ emit_cb (gpointer data)
|
|||||||
file_change_free (change);
|
file_change_free (change);
|
||||||
}
|
}
|
||||||
g_slist_free (pending);
|
g_slist_free (pending);
|
||||||
|
g_object_unref (monitor);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user