[Gnucash-changes] r13483 - gnucash/trunk - Rework the events generated by the account/group files and consumed by

Derek Atkins warlord at MIT.EDU
Wed Mar 8 15:49:14 EST 2006


David Hampton <hampton-gnucash at rainbolthampton.net> writes:

>> 2) You've now changed the MODIFY API, and I'm not convinced you've
>>    changed it globally.  That could be dangerous, in particular if the
>>    event gets emitted from somewhere that didn't know about the
>>    change.
>
> No, I've added a new modify api using the qof_event_gen function.  The
> old api using the gnc_engine_gen_event call is still there and is
> unchanged.  Since the account tree model must use the qof_event system
> for the REMOVE notification because of extra data required, it makes
> sense to use that API for all the events that account tree model
> watches.
>
> The qof_event_gen call should probably be moved inside of the 'if'
> statement, but I was getting persistent crashes when it was in that
> location.  When xaccAccountCommitEdit is called at the end of account
> destruction, the commit_edit_part2 call frees the allocated data
> structure and then the old callback functions is invoked.  I am unclear
> why the exiting event generation hook ever worked in this position since
> it can be called on a freed data structure.  I didn't have time to
> analyze the problem further, thus the current location of the call to
> qof_event_gen.

My concern is that you're generating two different event profiles with
QOF_EVENT_MODIFY against an Account QofEntity.  I think internally QOF
has only a single list of callback functions (although I must admit I
haven't looked closely).  So I think you need to be consistent with
how you use QOF_EVENT_MODIFY with an Account QofEntity and be sure
you're always using the same source and consumer syntax.

> David

-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