[wxPython] Re: PenPtr.__del__ exception caused during exit of application

Hi again,

I looked into the archive where I asked a similar question July 9, 2001.
Robin suggested
that I move the pens inside the __init__, which I did. The problem is back
again, maybe
because of the pens being in a list. This problem started to occur when I
moved to 2.3.0 as I recall.

Thanks,
Gordon Williams

···

----- Original Message -----
From: "Gordon Williams" <g_will@cyberus.ca>
To: "wxPython List" <wxpython-users@lists.wxwindows.org>
Sent: Wednesday, November 28, 2001 10:27 AM
Subject: PenPtr.__del__ exception caused during exit of application

Hi,

I am getting a list of exceptions generated when I close the application.
This is a
partial list below:

Exception exceptions.TypeError: 'call of non-function (type None)' in
<method wx

I looked into the archive where I asked a similar question July 9, 2001.
Robin suggested
that I move the pens inside the __init__, which I did. The problem is

back

again, maybe
because of the pens being in a list. This problem started to occur when I
moved to 2.3.0 as I recall.

Anytime the pens (or other objects) still exist when the wx.py module is
cleaned up then this can happen. The rules for the order of cleanup of
Python modules is complex, and AFAIK there isn't a way to control it.

My suggestion is to add a method to your panel that deletes the pens, and
then call that method before your frames closes and the app shutsdown.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!