[Gnucash-changes] r14495 - gnucash/trunk/src/register/ledger-core - Avoid crash from opening transaction in more than one register. Bug #347089.
Derek Atkins
warlord at MIT.EDU
Sun Jul 16 13:15:54 EDT 2006
Chris,
Chris Shoemaker <chris at cvs.gnucash.org> writes:
> -
> - gnc_suspend_gui_refresh ();
> -
> - info->pending_trans_guid = *xaccTransGetGUID(trans);
> if ((pending_trans != NULL) && (pending_trans != trans)) {
> + if (gnc_split_register_begin_edit_or_warn(info, trans))
> + return TRUE;
> +
> if (xaccTransIsOpen (pending_trans))
> xaccTransCommitEdit (pending_trans);
> else g_assert_not_reached();
> - g_assert(!xaccTransIsOpen(trans));
> - xaccTransBeginEdit(trans);
> }
> g_assert(xaccTransIsOpen(trans));
> pending_trans = trans;
> + gnc_suspend_gui_refresh ();
Are you sure you want to xaccTransCommitEdit() without being inside
suspend_gui_refresh()? I would think that this might cause strange
behaviors. Or was that your goal?
[snip]
> - gnc_suspend_gui_refresh ();
> -
> /* determine whether we should commit the pending transaction */
> if (pending_trans != trans)
> {
> // FIXME: How could the pending transaction not be open?
> // FIXME: For that matter, how could an open pending
> // transaction ever not be the current trans?
> - info->pending_trans_guid = *xaccTransGetGUID(trans);
> if (xaccTransIsOpen (pending_trans)) {
> g_message("Impossible? commiting pending %p", pending_trans);
> xaccTransCommitEdit (pending_trans);
> @@ -1371,10 +1383,13 @@
> g_assert(xaccTransIsOpen(blank_trans));
> } else {
> PINFO("beginning edit of trans %p", trans);
> - xaccTransBeginEdit (trans);
> + if (gnc_split_register_begin_edit_or_warn(info, trans))
> + return FALSE;
> }
> pending_trans = trans;
> }
> + g_assert(xaccTransIsOpen(trans));
> + gnc_suspend_gui_refresh ();
.. same question here..
-derek
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-devel
mailing list