mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-23 22:16:16 +01:00
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. https://bugzilla.gnome.org/show_bug.cgi?id=739424
This commit is contained in:
parent
16190d2dcd
commit
62e5ee5514
@ -131,7 +131,8 @@ got_new_info (GObject *source_object,
|
||||
poll_monitor->file,
|
||||
NULL, event);
|
||||
/* 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)) &&
|
||||
(event == G_FILE_MONITOR_EVENT_CHANGED))
|
||||
g_file_monitor_emit_event (G_FILE_MONITOR (poll_monitor),
|
||||
poll_monitor->file,
|
||||
NULL, G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT);
|
||||
|
Loading…
Reference in New Issue
Block a user