On 2/10/09, Charles Day <ceda...@gmail.com> wrote: > On Thu, Jan 29, 2009 at 10:28 AM, Charles Day <ceda...@gmail.com> wrote: > >> I have a question about how to destroy a transaction properly. Suppose I >> do >> the following to create a new transaction with one split. >> >> new_trans = xaccMallocTransaction (gnc_get_current_book ()); >> xaccTransBeginEdit (new_trans); >> xaccTransSetCurrency (new_trans, >> currency ? currency : gnc_default_currency()); >> xaccTransSetDateSecs (new_trans, info->last_date_entered); >> blank_split = xaccMallocSplit (gnc_get_current_book ()); >> xaccSplitSetParent(blank_split, new_trans); >> >> I haven't committed yet. Now what if I decide that I don't want this >> transaction or split any more? Will xaccTransRollbackEdit() get that done? >> If not, what is the correct way? >> >> I ask because the register tries to do it with xaccTransDestroy(), but >> since the transaction is still open, that doesn't actually work. >> > > Sorry to bump this, but does anyone know the answer? It would help fix bug > 346159.
Interesting. The generic import layer does this: xaccTransDestroy(trans); xaccTransCommitEdit(trans); to destroy an open transaction in gnc_import_exists_online_id(). It seems to work :-). Maybe the register code is missing the commit. Alan _______________________________________________ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel