[wxPython] wxPostEvent Crash

My application is almost totally event driven since it's very asynchronous. It basically
requests data from server,then posts an event to the requesting window when the
response arrives. The response can arrive in several pieces over several minutes.

The problem is that Python crashes (Dr. Watson) if the window no longer exists.

I was hoping wxPython would gracefully just eat the event rather than crash. I
can work around this in my app, but was wondering if this is the intended behavior.

Running Python 2.2.1, wxPython 2.2.3pre5 under Win2K.

Garry

···

-------------------------------------
Garry Simmons
simmonsg@symbol.com

The problem is that Python crashes (Dr. Watson) if the
window no longer exists.

I was hoping wxPython would gracefully just eat the event
rather than crash. I can work around this in my app, but
was wondering if this is the intended behavior.

Not intended, but something I havn't figured out how to work around yet.

Running Python 2.2.1, wxPython 2.2.3pre5 under Win2K.

If you change it from wxPostEvent to the following then you should get a
wxPyDeadObjectError exception raised. This is because in 2.3.3 when
OOR-capable objects are deleted in C++ their Python shadow object is changed
to raise the exception upon attribute access.

    theWindow.AddPendingEvent(theEvent)

···

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