2009/2/19 Brian Matherly <brian@gramps-project.org>
> Your investigation would mean we need to do
> > 1/search where the glade object is destroyed.
> > 2/see which extra objects are added to them outside of
> the glade or extracted from them (like a selection).
> > The unused objects tool can help here
> > 3/use del to explicitly delete those
>
> I will try this on one of the editor windows tomorrow night
> and see if it fixes the leaks. Something extra to note: I
> also looked at the Bookmarks window - which does NOT seem to
> leak. This window does not use glade to define itself and
> all the widgets are constructed from GTK objects inside the
> Bookmarks class. Many of the GTK objects are assigned to
> instance variables, none of which are explictly removed from
> scope with del.
>
> I think my theory needs to be modified a little to say that
> this is only relevant where the "top" window is
> defined in glade and has extra non-glade GTK objects added
> to it.

It sounds like we might be able to blame Glade. I've always hated messing with the Glade files. I prefer to edit UI code directly. Would anyone be opposed to an effort to systematically remove the Glade dependency?

I would be very much against this.
Rapid development of GUI is impossible without glade.
The changes we have done to the edit person and edit family dialogs have been done in 2 hours of fiddling with glade, this would be impossible without it.
If a gui toolkit does not have a gui designer, I would rather not touch it.
I agree glade is not very good compared to visual studio or qt designer, but it's the only way to do things with GTK I know of.
Should glade be able to generate python code we could use in a function (create_interface() eg), that would be a viable alternative.

If this investigation of Gary is correct, the problem of memory leak comes down to using tools we don't know sufficiently well. We should do a guideline that people who do GUI coding should use the unused object tool. I did this when starting to code on GRAMPS, but there where so many issues in code outside the things I was hacking on, that I gave up.
If Gary tries now eg with EditPlace, and posts the patch on the blog or in wiki with the explanation of the changes, I'm sure some other devels can help in an effort to reduce the main memory leaks.

Benny