[balsa/gtk3] Plug memory leak



commit 5616d01e043b5cea33eb7e56809c4f4f3f854fa1
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Aug 29 23:45:40 2016 -0400

    Plug memory leak
    
        * src/main-window.c (bw_create_index_widget): do not leak
        focus-chain GList.

 ChangeLog         |    7 +++++++
 src/main-window.c |    8 ++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6640e6e..d41f90d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-08-29  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Plug memory leak.
+
+       * src/main-window.c (bw_create_index_widget): do not leak
+       focus-chain GList.
+
 2016-08-21  Albrecht Dreß
 
        Always use multithreading, and use only the glib abstraction
diff --git a/src/main-window.c b/src/main-window.c
index 70c72b9..4856383 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -455,6 +455,7 @@ bw_create_index_widget(BalsaWindow *bw)
 {
     GtkWidget *vbox, *button;
     unsigned i;
+    GList *focusable_widgets;
 
     if(!view_filters_translated) {
         for(i=0; i<ELEMENTS(view_filters); i++)
@@ -503,8 +504,11 @@ bw_create_index_widget(BalsaWindow *bw)
     gtk_widget_show(bw->sos_bar);
     gtk_box_pack_start(GTK_BOX(vbox), bw->sos_bar, FALSE, FALSE, 0);
     gtk_box_pack_start(GTK_BOX(vbox), bw->notebook, TRUE, TRUE, 0);
-    gtk_container_set_focus_chain(GTK_CONTAINER(vbox),
-                                  g_list_append(NULL, bw->notebook));
+
+    focusable_widgets = g_list_append(NULL, bw->notebook);
+    gtk_container_set_focus_chain(GTK_CONTAINER(vbox), focusable_widgets);
+    g_list_free(focusable_widgets);
+
     gtk_widget_set_sensitive(button, FALSE);
     gtk_widget_show(vbox);
     return vbox;


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