[glib/glib-2-62: 2/4] gdesktopappinfo: Cancel file monitor when resetting a DesktopFileDir



commit fd15e33bc89ceb3f4545e12d6c0fb1a1ed7e7d5e
Author: Philip Withnall <withnall endlessm com>
Date:   Fri Oct 11 22:19:29 2019 +0100

    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

 gio/gdesktopappinfo.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 7e2c35327..f1e2fdd65 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -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;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]