diff options
author | Robert Bragg <robert@linux.intel.com> | 2009-05-06 09:20:43 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2009-05-29 01:17:32 -0400 |
commit | c2ed17a1a712cb446d8e62d9697bffa0cdf1a585 (patch) | |
tree | 690e9448f1f52135d84dae3a8a4412b719e1364f | |
parent | eb6c59bc48ccec382925ffc3b32e5bfa1e0479b7 (diff) | |
download | glib-c2ed17a1a712cb446d8e62d9697bffa0cdf1a585.tar.gz |
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.
-rw-r--r-- | gio/gfilemonitor.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gio/gfilemonitor.c b/gio/gfilemonitor.c index 108e7a6c4..41444e360 100644 --- a/gio/gfilemonitor.c +++ b/gio/gfilemonitor.c @@ -364,6 +364,7 @@ emit_cb (gpointer data) monitor->priv->pending_file_changes = NULL; monitor->priv->pending_file_change_id = 0; + g_object_ref (monitor); for (iter = pending; iter; iter = iter->next) { FileChange *change = iter->data; @@ -372,6 +373,8 @@ emit_cb (gpointer data) file_change_free (change); } g_slist_free (pending); + g_object_unref (monitor); + return FALSE; } |