[libadwaita/msvc: 13/19] adw-tab-view-demo-window.c: Plug a leak




commit e00c5c8e4d74e22d27c595f9b0fbd1cc07825b9b
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Jan 18 11:52:11 2022 +0800

    adw-tab-view-demo-window.c: Plug a leak
    
    Fix a mishap on removing g_autoptr().  Also fix styling issues a bit.

 demo/pages/tab-view/adw-tab-view-demo-window.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/demo/pages/tab-view/adw-tab-view-demo-window.c b/demo/pages/tab-view/adw-tab-view-demo-window.c
index 807e49d4..5aa8575f 100644
--- a/demo/pages/tab-view/adw-tab-view-demo-window.c
+++ b/demo/pages/tab-view/adw-tab-view-demo-window.c
@@ -116,7 +116,6 @@ tab_new (GSimpleAction *action,
   icon = get_random_icon (self);
 
   page = add_page (self, NULL, title, icon);
-  g_free (title);
   content = adw_tab_page_get_child (page);
 
   adw_tab_view_set_selected_page (self->view, page);
@@ -124,6 +123,8 @@ tab_new (GSimpleAction *action,
   gtk_widget_grab_focus (content);
 
   next_page++;
+
+  g_free (title);
 }
 
 static AdwTabPage *
@@ -456,6 +457,8 @@ indicator_activated_cb (AdwTabViewDemoWindow *self,
   icon = get_indicator_icon (page);
 
   adw_tab_page_set_indicator_icon (page, icon);
+
+  g_object_unref (icon);
 }
 
 static gboolean


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