Commit 62e5ee55 authored by Allison Karlitskaya's avatar Allison Karlitskaya Committed by Matthias Clasen
Browse files

gpollfilemonitor: don't emit after cancellation

GPollFileMonitor emits CHANGES_DONE_HINT after CHANGED signals, but it
doesn't check to ensure that the file monitor wasn't cancelled before it
does that.

If the original signal caused the monitor to be unreffed, cancelled and
destroyed, we would still end up emitting an extra signal on it.

Avoid that by checking first for cancellation.
parent 16190d2d
...@@ -131,7 +131,8 @@ got_new_info (GObject *source_object, ...@@ -131,7 +131,8 @@ got_new_info (GObject *source_object,
poll_monitor->file, poll_monitor->file,
NULL, event); NULL, event);
/* We're polling so slowly anyway, so always emit the done hint */ /* We're polling so slowly anyway, so always emit the done hint */
if (event == G_FILE_MONITOR_EVENT_CHANGED) if (!g_file_monitor_is_cancelled (G_FILE_MONITOR (poll_monitor)) &&
g_file_monitor_emit_event (G_FILE_MONITOR (poll_monitor), g_file_monitor_emit_event (G_FILE_MONITOR (poll_monitor),
poll_monitor->file, poll_monitor->file,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment