[wxPython] Closing down wxFrames

0 views
Skip to first unread message

Gareth Walters

unread,
Mar 21, 2002, 10:06:01 AM3/21/02
to wxpytho...@lists.wxwindows.org
G'day all,
I have seen some questions about this in the archive but nothin that really
helped...

I am tracking down some memory leaks in my App by manually calling their
Destroy methods in the window closing process
(not pretty but it means I know which objects are responsible).

The problem is I hooked this up assuming someone (ie me) selected exit from
the menu,
when the close button in the window manager is hit it doesn't call the
method I created.

Fair enough, I then put in an EVT_CLOSE to call that same function, but its
calling it twice, and
subsequently crashes.

So what do I have to do to get it called once when the close button is
pressed?


----Gareth Walters
http://www.bigworldgames.com
http://www.microforte.com.au

Hans-Peter Jansen

unread,
Mar 21, 2002, 12:15:03 PM3/21/02
to wxpytho...@lists.wxwindows.org, Gareth Walters
On Friday, 22. March 2002 00:04, Gareth Walters wrote:
> G'day all,
> I have seen some questions about this in the archive but nothin that
> really helped...
>
> I am tracking down some memory leaks in my App by manually calling their
> Destroy methods in the window closing process
> (not pretty but it means I know which objects are responsible).
>
> The problem is I hooked this up assuming someone (ie me) selected exit from
> the menu,
> when the close button in the window manager is hit it doesn't call the
> method I created.
>
> Fair enough, I then put in an EVT_CLOSE to call that same function, but its
> calling it twice, and
> subsequently crashes.
>
> So what do I have to do to get it called once when the close button is
> pressed?

What about using a flag semaphore? It's not uncommon, that the EVT_CLOSE
handler is called multiple times. You will have to deal with it...

Cheers,
Hans-Peter

Reply all
Reply to author
Forward
0 new messages