[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_4-106-ge9f772f

Philippe Delorme nobody at users.sourceforge.net
Sun Nov 13 22:14:26 CET 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  e9f772fd2eed45bdb1f309bddd20ffb1e0c0d500 (commit)
      from  4057a71e0a87b790eee0408b01b7f35a79ea5ed1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e9f772fd2eed45bdb1f309bddd20ffb1e0c0d500
Author: Philippe Delorme <philippedelorme at users.sourceforge.net>
Date:   Sun Nov 13 22:12:01 2011 +0100

    Bet: fixed memory leaks
    
    Few lost references on GDate objects

-----------------------------------------------------------------------

Changes:
diff --git a/src/bet_data.c b/src/bet_data.c
index 518c910..03336a8 100644
--- a/src/bet_data.c
+++ b/src/bet_data.c
@@ -1493,15 +1493,18 @@ GDate *bet_data_array_get_date_max ( gint account_number )
 {
     GDate *date_min;
     GDate *date_max;
+    GDate *date_tmp;
 
     date_min = gsb_data_account_get_bet_start_date ( account_number );
 
     date_max = gsb_date_copy ( date_min );
+    date_tmp = date_max;
 
     if ( g_date_get_day ( date_min ) == 1 )
     {
         g_date_add_months (date_max, gsb_data_account_get_bet_months ( account_number ) - 1 );
-        date_max = gsb_date_get_last_day_of_month ( date_max );
+        date_max = gsb_date_get_last_day_of_month ( date_tmp );
+        g_date_free ( date_tmp );
     }
     else
     {
@@ -1509,6 +1512,8 @@ GDate *bet_data_array_get_date_max ( gint account_number )
         g_date_subtract_days ( date_max, 1 );
     }
 
+    g_date_free ( date_min );
+
     return date_max;
 }
 
diff --git a/src/bet_tab.c b/src/bet_tab.c
index f3ee40c..d4c76d3 100644
--- a/src/bet_tab.c
+++ b/src/bet_tab.c
@@ -1076,7 +1076,7 @@ void bet_array_list_add_new_hist_line ( GtkTreeModel *tab_model,
                         GDate *date_max )
 {
     GtkTreeIter tab_iter;
-    GDate *date;
+    GDate *date, *date_tmp;
     GDate *date_jour;
     GValue date_value = {0, };
     gchar *str_date;
@@ -1160,9 +1160,16 @@ void bet_array_list_add_new_hist_line ( GtkTreeModel *tab_model,
         g_value_unset ( &date_value );
         g_free ( str_date );
         g_date_add_months ( date, 1 );
-        date = gsb_date_get_last_day_of_month ( date );
+
+        date_tmp = date;
+        date = gsb_date_get_last_day_of_month ( date_tmp );
+        g_date_free ( date_tmp );
     }
 
+    if ( date )
+        g_date_free ( date );
+    if ( date_jour )
+        g_date_free ( date_jour );
     g_free ( str_description );
     g_free ( str_debit );
     g_free ( str_value );


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list