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

Chris Shoemaker c.shoemaker at cox.net
Mon Mar 6 19:09:53 EST 2006


On Mon, Mar 06, 2006 at 02:33:13PM -0500, David Hampton wrote:
> On Mon, 2006-03-06 at 09:09 -0500, Derek Atkins wrote:
> > David,
> > 
> > David Hampton <hampton at cvs.gnucash.org> writes:
> > 
> > > +  ed.node = acc;
> > > +  ed.idx = 0;
> > > +  qof_event_gen(&acc->inst.entity, QOF_EVENT_MODIFY, &ed);
> > > +
> > >    if (qof_commit_edit_part2(&acc->inst, on_err, noop, acc_free))
> > >        gnc_engine_gen_event (&acc->inst.entity, GNC_EVENT_MODIFY);
> > >  }
<snip>
> 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.

Um, that's certainly a thinko on my part.  The event generation should
be done from inside the on_done callback, (the one which is currently
called 'noop').  The 'on_free' call back already results in generating
GNC_EVENT_DESTROY.  And 'on_err' should rollback, but that's
unimplemented.

I'll fix that right away.

-chris


More information about the gnucash-devel mailing list