[nautilus] general: always use nautilus_file_ref



commit 77e51a3545df31e6c80842dd5db76bd24f3a8fee
Author: Carlos Soriano <csoriano gnome org>
Date:   Wed Nov 25 20:21:35 2015 +0100

    general: always use nautilus_file_ref
    
    So we can debug ref counting issues more comfortably.

 src/nautilus-files-view.c      |   10 ++++------
 src/nautilus-window-slot-dnd.c |    2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 38b1800..cfd4d64 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1725,7 +1725,7 @@ new_folder_done (GFile    *new_folder,
                 sdata->directory_view = directory_view;
                 sdata->to_remove_locations = g_hash_table_new_full (g_file_hash, (GEqualFunc)g_file_equal,
                                                                     g_object_unref, NULL);
-                sdata->new_folder = g_object_ref (file);
+                sdata->new_folder = nautilus_file_ref (file);
 
                 uris = NULL;
                 for (l = data->selection; l != NULL; l = l->next) {
@@ -2866,10 +2866,8 @@ nautilus_files_view_destroy (GtkWidget *object)
         }
 
 
-        if (view->details->directory_as_file) {
-                nautilus_file_unref (view->details->directory_as_file);
-                view->details->directory_as_file = NULL;
-        }
+        nautilus_file_unref (view->details->directory_as_file);
+        view->details->directory_as_file = NULL;
 
         g_clear_object (&view->details->search_query);
         g_clear_object (&view->details->location);
@@ -6975,7 +6973,7 @@ load_directory (NautilusFilesView *view,
 
         g_set_object (&view->details->model, directory);
 
-        g_clear_object (&view->details->directory_as_file);
+        nautilus_file_unref (view->details->directory_as_file);
         view->details->directory_as_file = nautilus_directory_get_corresponding_file (directory);
 
         g_clear_object (&view->details->location);
diff --git a/src/nautilus-window-slot-dnd.c b/src/nautilus-window-slot-dnd.c
index 0cf25ef..335cfe0 100644
--- a/src/nautilus-window-slot-dnd.c
+++ b/src/nautilus-window-slot-dnd.c
@@ -480,7 +480,7 @@ nautilus_drag_slot_proxy_init (GtkWidget *widget,
   drag_info->is_notebook = (g_object_get_data (G_OBJECT (widget), "nautilus-notebook-tab") != NULL);
 
   if (target_file != NULL)
-    drag_info->target_file = g_object_ref (target_file);
+    drag_info->target_file = nautilus_file_ref (target_file);
 
   if (target_slot != NULL)
     drag_info->target_slot = g_object_ref (target_slot);


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