PGA3 Memory Leaks - Mailing list pgadmin-hackers

From efesar
Subject PGA3 Memory Leaks
Date
Msg-id NGBBKFMOILMAGDABPFEGEEAHEEAA.efesar@nmia.com
Whole thread Raw
Responses Re: PGA3 Memory Leaks  (Andreas Pflug <Andreas.Pflug@web.de>)
List pgadmin-hackers
Andreas,

You made this change around line 347 in frmMain.cpp:

/*
    // Keith 2003.03.05
    // Fixed memory leak -- These are not destroyed automatically
       // Andreas 2003-04-08 yes they are, cascaded through the splitter!
        // GTK won't like explicit deletes.
    delete treeContextMenu;
    delete browserImages;
    delete statisticsImages;
    delete propertiesImages;
    delete statistics;
*/

I'm sorry, but this is incorrect.

1) Treecontextmenu does not get deleted automatically. It is a context menu,
and it never gets attached to the window. See the docs for wxWindow:

"Just before the menu is popped up, wxMenu::UpdateUI is called to ensure
that the menu items are in the correct state. The menu does not get deleted
by the window."

2) Imagelists do not get deleted automatically. It says that specifically in
the documentation for wxTreeCtrl.

"Sets the normal image list. Image list assigned with this method will not
be deleted by wxTreeCtrl's destructor, you must delete it yourself."

3) Statistics does not appear to need to be deleted.

Therefore, I've undone the change.

-Keith


pgadmin-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: PGA2: add Locks, fix depend
Next
From: Andreas Pflug
Date:
Subject: Re: PGA3 Memory Leaks