[PATCH] Fix generic import skipped transactions

David Reiser dbreiser at earthlink.net
Wed Feb 11 01:22:01 EST 2009


On Feb 10, 2009, at 9:14 AM, Alan Jenkins wrote:

> Sorry, bad commit description.  Here's the corrected version.
>> From b4f28335d813aa5c0a32802610f8cc48e2345eb5 Mon Sep 17 00:00:00  
>> 2001
> From: Alan Jenkins <alan-jenkins at tuffmail.co.uk>
> Date: Tue, 10 Feb 2009 14:13:14 +0000
> Subject: [PATCH] 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
>
> Signed-off-by: Alan Jenkins <alan-jenkins at tuffmail.co.uk>
> ---
> src/import-export/import-main-matcher.c |   14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/src/import-export/import-main-matcher.c b/src/import- 
> export/import-main-matcher.c
> index 6699085..ded996f 100644
> --- a/src/import-export/import-main-matcher.c
> +++ b/src/import-export/import-main-matcher.c
> @@ -89,9 +89,23 @@ refresh_model_row(GNCImportMainMatcher *gui,  
> GtkTreeModel *model,
>
> 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));
> -- 
> 1.5.4.3
>
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Fantastic. Now all we need is for the register code to refresh the  
window to remove the blank lines left behind when the transactions are  
skipped.

Thank you for fixing the bug.

Dave
--
David Reiser
dbreiser at earthlink.net






More information about the gnucash-devel mailing list