[gnome-photos/gnome-3-26] main-toolbar: Don't leak the preview's GMenu



commit 58afe6a3cafb7a2eeb7c6e08a6b83d684edc44e7
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Nov 6 17:36:02 2017 +0100

    main-toolbar: Don't leak the preview's GMenu

 src/photos-main-toolbar.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index a1135db..1c65535 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -506,7 +506,7 @@ photos_main_toolbar_populate_for_overview (PhotosMainToolbar *self)
 static void
 photos_main_toolbar_populate_for_preview (PhotosMainToolbar *self)
 {
-  GMenu *preview_menu;
+  GMenu *preview_menu = NULL;
   GtkWidget *back_button;
   GtkWidget *edit_button;
   GtkWidget *image;
@@ -565,6 +565,8 @@ photos_main_toolbar_populate_for_preview (PhotosMainToolbar *self)
                            G_CALLBACK (photos_main_toolbar_item_active_changed),
                            self,
                            G_CONNECT_SWAPPED);
+
+  g_object_unref (preview_menu);
 }
 
 


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