r17864 - gnucash/branches/2.2/src/register/ledger-core -  Bug #435642: Fix crash when editing results of a find
cstim at cvs.gnucash.org
Sat Jan 31 05:46:19 EST 2009
Date: 2009-01-31 05:46:19 -0500 (Sat, 31 Jan 2009)
New Revision: 17864
 Bug #435642: Fix crash when editing results of a find
I finally got around to looking into this some more. I think the problem is a
result of an interaction between gnc_split_register_redraw and
gnc_split_register_find_split when called from gnc_split_register_move_cursor
in split-register-control.c. As the comment says, "redrawing the register can
muck everything up". In particular calling gnc_split_register_redraw may
change the "transaction split" for some or all of the transactions if the
register is a "ledger" style register such as the one for find results. This
causes the subsequent call to gnc_split_register_find_split to find the wrong
register row if the cursor class being found is CURSOR_CLASS_TRANS. Whether
this causes a crash seems to depend on circumstances I haven't quite figured
out, but I have one test file that crashes 100% of the time in r17804.
This patch changes the way gnc_split_register_find_split works when asked to
find the transaction split for a transaction. It assumes that any transaction
can only have one such split and returns as soon as it finds a row containing
it. If you think this is wrong, let me know and I'll try something else.
Patch by Mike Alexander.
More information about the gnucash-patches