[gthumb] vfs tree: reset the timeout id when no more needed



commit ba2f27e09ea739efa82bb2251671f8991ff58ba1
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Dec 7 20:01:56 2019 +0100

    vfs tree: reset the timeout id when no more needed

 gthumb/gth-vfs-tree.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gthumb/gth-vfs-tree.c b/gthumb/gth-vfs-tree.c
index bd0eaeda..a90a9b69 100644
--- a/gthumb/gth-vfs-tree.c
+++ b/gthumb/gth-vfs-tree.c
@@ -92,6 +92,9 @@ load_data_vfs_tree_destroy_cb (GtkWidget *widget,
 
        gth_file_source_cancel (load_data->file_source);
        g_cancellable_cancel (load_data->cancellable);
+
+       g_signal_handler_disconnect (load_data->vfs_tree, load_data->destroy_id);
+       load_data->destroy_id = 0;
 }
 
 
@@ -153,7 +156,8 @@ load_data_new (GthVfsTree *vfs_tree,
 static void
 load_data_free (LoadData *data)
 {
-       g_signal_handler_disconnect (data->vfs_tree, data->destroy_id);
+       if (data->destroy_id != 0)
+               g_signal_handler_disconnect (data->vfs_tree, data->destroy_id);
        _g_object_unref (data->last_loaded);
        _g_object_list_unref (data->list);
        g_object_unref (data->cancellable);
@@ -501,6 +505,8 @@ monitor_data_vfs_tree_destroy_cb (GtkWidget *widget,
        MonitorEventData *monitor_data = user_data;
 
        gth_file_source_cancel (monitor_data->file_source);
+       g_signal_handler_disconnect (monitor_data->vfs_tree, monitor_data->destroy_id);
+       monitor_data->destroy_id = 0;
 }
 
 
@@ -541,7 +547,8 @@ monitor_event_data_unref (MonitorEventData *monitor_data)
        if (monitor_data->ref > 0)
                return;
 
-       g_signal_handler_disconnect (monitor_data->vfs_tree, monitor_data->destroy_id);
+       if (monitor_data->destroy_id != 0)
+               g_signal_handler_disconnect (monitor_data->vfs_tree, monitor_data->destroy_id);
        _g_object_unref (monitor_data->vfs_tree);
        _g_object_unref (monitor_data->parent);
        _g_object_unref (monitor_data->file_source);


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