gdesktopappinfo: Cancel file monitor when resetting a DesktopFileDir

It’s not enough to unref the monitor, since the GLib worker thread might
still hold a reference to it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1903
This commit is contained in:
Philip Withnall 2019-10-11 22:19:29 +01:00
parent bffe058550
commit 5b07fc98e0

View File

@ -1329,6 +1329,7 @@ desktop_file_dir_reset (DesktopFileDir *dir)
if (dir->monitor)
{
g_signal_handlers_disconnect_by_func (dir->monitor, desktop_file_dir_changed, dir);
g_file_monitor_cancel (dir->monitor);
g_object_unref (dir->monitor);
dir->monitor = NULL;
}