[grisbi-devel] [PATCH 7/7] Fix 2 leaks of GSList "sup_payees" in tiers_onglet.c

RĂ©mi Cardona remi at gentoo.org
Wed Jan 30 08:42:37 CET 2013


This list is created and updated when running the payee editing/merging
wizard. It holds the id numbers of payees that will ultimately be
removed. This GSList is stored as a data property of the gsb_assitant
widget initialized in payees_manage_payees().

This patch makes sure that the list is freed before being overwritten or
when its parent object is freed.
---
 src/tiers_onglet.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/tiers_onglet.c b/src/tiers_onglet.c
index a9851ec..75bbb1a 100644
--- a/src/tiers_onglet.c
+++ b/src/tiers_onglet.c
@@ -1013,6 +1013,7 @@ void payees_manage_payees ( void )
         gsb_status_stop_wait ( TRUE );
     }
 
+    g_slist_free ( g_object_get_data ( G_OBJECT (assistant), "sup_payees" ) );
     gtk_widget_destroy (assistant);
 }
 
@@ -1372,6 +1373,7 @@ static gboolean gsb_assistant_payees_enter_page_3 ( GtkWidget *assistant )
         gtk_label_set_text ( GTK_LABEL (label), str );
         g_free ( str );
 
+        g_slist_free ( g_object_get_data ( G_OBJECT (assistant), "sup_payees" ) );
         g_object_set_data ( G_OBJECT (assistant), "sup_payees", sup_payees );
     }
     return FALSE;
-- 
1.8.1.1



More information about the devel mailing list