QSF Import of gncCustomer and gncAddress Issues (and partial success)

Derek Atkins warlord at MIT.EDU
Tue May 30 16:37:19 EDT 2006


Quoting Georgi Mirchev <manager at mirchevideas.com>:

> Well, there is no qof_instance_destroy(), only 
> qof_instance_release(), which doesn't deregister from the book. It 
> doesn't actually matter which object is destroyed, since both are in 
> the book, and if any of them is destroyed without deregistering 
> segfault will follow. To me it doesn't make sense to call a 
> setAddress function and get the object you pass as parameter 
> destroyed.

release().. destroy()..   Po-TAY-to, Po-TAH-to..  Same thing.  It's
certainly arguable whether this function should remove the object from
the book collection.  It's also arguable whether the init() function
should add the object to the collection.

Please read the archives..  We've discussed this a lot.

As for your last sentece...  QSF is dain-bramaged and requires very
special hand-holding...  It was retrofitted onto the GNC functions and
done so poorly.  I admire your spirit for trying to get it working, but
the more time I spend in that code the more problems I find with it..  Memory
leaks notwithstanding (and I've found tons of those, too!)

> My suggestion is to have the current gncAddressDestroy() to call 
> qof_instance_release(), and modify qof_instance_release() to actually 
> remove the object from the book. This should solve all problems, 
> unless you spot a something smelly here :-)

You should follow what other objects do in terms of destruction.
This is what I said about the fact that GncAddress wasn't completely
converted to QOF.  You should set do_free = TRUE and then call qof_commit_edit
to get it to destroy the object.

But no, qof_instance_release() is fine.  It's the improper usage in
gncAddress that's the problem.

-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