[nautilus/gnome-3-20] files-view: unref directory after calling _get_by_uri()



commit c0458bd65ff0846bf0170728dbd56014e0b365fd
Author: Ernestas Kulik <ernestask src gnome org>
Date:   Tue Jul 26 12:49:05 2016 +0300

    files-view: unref directory after calling _get_by_uri()
    
    update_scripts_menu() and update_templates_menu() do not unref the
    directories after calling nautilus_directory_get_by_uri(), which results
    in leaks. This commit fixes that by adding calls to
    nautilus_directory_unref().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769182

 src/nautilus-files-view.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index be8c31b..021943a 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -4915,6 +4915,8 @@ update_scripts_menu (NautilusFilesView *view)
                 g_object_unref (submenu);
         }
 
+        nautilus_directory_unref (directory);
+
         view->details->scripts_present = submenu != NULL;
 }
 
@@ -5137,6 +5139,8 @@ update_templates_menu (NautilusFilesView *view)
                 g_object_unref (submenu);
         }
 
+        nautilus_directory_unref (directory);
+
         view->details->templates_present = submenu != NULL;
 
         g_free (templates_directory_uri);


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