PGA3 Memory Leaks

From: efesar <efesar(at)nmia(dot)com>
To: Pgadmin-Hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: PGA3 Memory Leaks
Date: 2003-04-16 18:27:07
Message-ID: NGBBKFMOILMAGDABPFEGEEAHEEAA.efesar@nmia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Andreas Pflug 2003-04-16 19:16:42 Re: PGA3 Memory Leaks
Previous Message Dave Page 2003-04-16 15:05:13 Re: PGA2: add Locks, fix depend