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



commit 4673f992d04594b513bee89f9c77612e279ef203
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 10fce3f..40fb6b6 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -449,7 +449,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 *edit_button;
   GtkWidget *image;
   GtkWidget *menu_button;
@@ -506,6 +506,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]