wxEventLoop::Exit is running ?

Hi,

My clientas ar using wxPython based application, but time to time the are
rporting unwanted freeze of modal dialogs.
After running the same apllication I'v got the same result - fast working with
esc/cancel(wxID_OK) - ok(wxID_CANCEL) - can make modal dialogs hidden :frowning:

As simple example please run attached file and while cliking X (upper right
corner) please press ESC - key. On my machine widows xp sp with sp2 and
wxWidgets 2.6.3 and python 2.5 - everything from cvs in debug version I'm
gotting in debug build:
Traceback (most recent call last):
  File "00-bang.py", line 43, in ShowMe
    d.ShowModal()
  File "s:\binw\py25\site-packages\wx-2.6.3\wx\_windows.py", line 688, in
ShowModal
    return _windows_.Dialog_ShowModal(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in
s:\gnus\wxwindows\v263-2\src\msw\evt
loop.cpp(321): can't call Exit() if not running

in release application look's like hanged - but last widow is onnly hidden -
(sic!) but modal

mak

bang.py.txt (1.67 KB)

trimak@trisoft.com.pl wrote:

Hi,

My clientas ar using wxPython based application, but time to time the are
rporting unwanted freeze of modal dialogs.
After running the same apllication I'v got the same result - fast working with
esc/cancel(wxID_OK) - ok(wxID_CANCEL) - can make modal dialogs hidden :frowning:

As simple example please run attached file and while cliking X (upper right
corner) please press ESC - key. On my machine widows xp sp with sp2 and
wxWidgets 2.6.3 and python 2.5 - everything from cvs in debug version I'm
gotting in debug build:

I assume there's some reason that suggesting that you not press ESC and click the close button at the same time would not be applicable?

My guess is that this is a matter of a race condition between the system close and the wx handling of the ESC key. By the time it gets around to completing the processing of the second one the first one has already started the process and hidden the window. I would try wrapping the ShowModal in a try:...finally to make sure that the dialog is destroyed when the assertion is raised.

···

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