[grisbi-devel] [PATCH 13/15] Fix leak of account icon GdkPixbufs in navigation.c

RĂ©mi Cardona remi at gentoo.org
Sat Mar 9 16:54:05 CET 2013


This also leaked the GQueue structures
---
 src/navigation.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/navigation.c b/src/navigation.c
index 6e0b594..cf0ab68 100644
--- a/src/navigation.c
+++ b/src/navigation.c
@@ -1884,6 +1884,8 @@ void gsb_gui_navigation_init_pages_list ( void )
 {
     GQueue *new_queue;
 
+    gsb_gui_navigation_free_pages_list ( );
+
     new_queue = g_queue_new ( );
     pages_list = new_queue;
     gsb_gui_navigation_set_page_list_order ( default_navigation_order_list );
@@ -1909,8 +1911,12 @@ void gsb_gui_navigation_clear_pages_list ( void )
  */
 void gsb_gui_navigation_free_pages_list ( void )
 {
+    if ( ! pages_list )
+        return;
+
     g_queue_foreach ( pages_list, (GFunc) g_free, NULL );
     g_queue_free ( pages_list );
+    pages_list = NULL;
 }
 
 
-- 
1.8.1.4



More information about the devel mailing list