[balsa/application-notification] Plug leak



commit 6abb29532a1438c814ad93f958fa96bc003c64e0
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Jun 20 17:46:40 2018 -0400

    Plug leak
    
    * src/main-window.c (view_source_activated), (bw_set_menus): Do
      not leak application.

 ChangeLog         | 5 +++++
 src/main-window.c | 8 +++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4e1a9ce33..91f68f1e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-20  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       * src/main-window.c (view_source_activated), (bw_set_menus): Do
+       not leak application.
+
 2018-06-20  Peter Bloomfield  <pbloomfield bellsouth net>
 
        * src/main-window.c
diff --git a/src/main-window.c b/src/main-window.c
index 58fa44bb1..669d4c144 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -1543,8 +1543,9 @@ view_source_activated(GSimpleAction * action,
     bindex = balsa_window_find_current_index(window);
     g_return_if_fail(bindex != NULL);
 
-    messages = balsa_index_selected_list(BALSA_INDEX(bindex));
     g_object_get(G_OBJECT(window), "application", &application, NULL);
+
+    messages = balsa_index_selected_list(BALSA_INDEX(bindex));
     for (list = messages; list; list = list->next) {
        LibBalsaMessage *message = list->data;
 
@@ -1554,8 +1555,9 @@ view_source_activated(GSimpleAction * action,
                                      &balsa_app.source_width,
                                      &balsa_app.source_height);
     }
-
     g_list_free_full(messages, g_object_unref);
+
+    g_object_unref(application);
 }
 
 static void
@@ -2056,7 +2058,6 @@ bw_set_menus(BalsaWindow * window)
     GError *err = NULL;
 
     g_object_get(G_OBJECT(window), "application", &application, NULL);
-
     bw_add_app_action_entries(G_ACTION_MAP(application), window);
     bw_add_win_action_entries(G_ACTION_MAP(window));
 
@@ -2076,6 +2077,7 @@ bw_set_menus(BalsaWindow * window)
         g_error_free(err);
     }
     g_object_unref(builder);
+    g_object_unref(application);
 }
 
 /*


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