Book Closing in HEAD kills objects in a "bad" order, corrupts
memory.
Derek Atkins
warlord at MIT.EDU
Wed May 26 09:45:55 EDT 2004
linas at linas.org (Linas Vepstas) writes:
> Hey' didn't you write that code? I think its pulling from a hash table,
> which is why its random order. I don't remember how things work during
> startup. It should be easier during startup, where one can clearly
> spec a dependency graph (this depends on that being intited, so go init
> that now).
Yes, I wrote this code... but when I did write it the only users were
the business functions. The existing engine objects had a
well-defined load/unload order, but I implemented the business objects
to handle loading and unloading in random order. For example, if an
Invoice gets loaded before it's Customer, it'll create a Customer
Placeholder object -- so when the Customer gets loaded it will fill in
the placeholder. Voila, random loading.
The only potential problem is if you have dangling references, but
that can only happen with a corrupted data file. The program enforces
the references.
This is also why I never implemented "delete" :)
-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