r17915 - gnucash/branches/2.2/src/import-export - [17891] Bug #552275, #434944: Fix generic import skipped transactions

Andreas Köhler andi5 at cvs.gnucash.org
Sat Feb 14 16:34:18 EST 2009


Author: andi5
Date: 2009-02-14 16:34:18 -0500 (Sat, 14 Feb 2009)
New Revision: 17915
Trac: http://svn.gnucash.org/trac/changeset/17915

Modified:
   gnucash/branches/2.2/src/import-export/import-main-matcher.c
Log:
[17891] Bug #552275, #434944: Fix generic import skipped transactions

gnc_import_TransInfo_delete() was defined but never called!
This led to a memory leak, and erroneous behaviour.

 Bug 552275 - Cancelling OFX Import Still Adds Entries
 Bug 434944 - Refused transactions from import appear in register

Patch by Alan Jenkins <alan-jenkins at tuffmail.co.uk>

Original commit by cstim.

Modified: gnucash/branches/2.2/src/import-export/import-main-matcher.c
===================================================================
--- gnucash/branches/2.2/src/import-export/import-main-matcher.c	2009-02-14 21:12:40 UTC (rev 17914)
+++ gnucash/branches/2.2/src/import-export/import-main-matcher.c	2009-02-14 21:34:18 UTC (rev 17915)
@@ -89,9 +89,23 @@
 
 void gnc_gen_trans_list_delete (GNCImportMainMatcher *info)
 {
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  GNCImportTransInfo *trans_info;
+
   if (info == NULL) 
     return;
 
+  model = gtk_tree_view_get_model(info->view);
+  if (gtk_tree_model_get_iter_first(model, &iter)) {
+    do {
+      gtk_tree_model_get(model, &iter,
+		         DOWNLOADED_COL_DATA, &trans_info,
+		         -1);
+      gnc_import_TransInfo_delete(trans_info);
+    } while (gtk_tree_model_iter_next (model, &iter));
+  }
+
   gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->dialog));
   gnc_import_Settings_delete (info->user_settings);
   gtk_widget_destroy (GTK_WIDGET (info->dialog));



More information about the gnucash-changes mailing list