[wxPython-users] Application crashes after running a wxPython
application via MS ActiveScript
Robin Dunn
robin at alldunn.com
Fri Feb 8 14:10:40 PST 2008
Klaus Nökel wrote:
> Hi everybody,
>
> I am tracking a mysterious bug, trying to determine whether wxPython,
> pywin32, Windows or our own application is at fault. The set-up is as
> follows:
>
> - Our own application uses the MS ActiveScript technology to let users
> automate their workflow with scripts.
> - The favorite script language is Python, the favorite GUI library is
> wxPython.
> - In some circumstances, our own application will crash when the next
> dialog opens after the user has executed a script containig wxPython GUI
> elements. The call stack displays flaky, but if I can believe it, the
> crash happens somewhere in MS territory where event handling is set up
> for the new dialog.
>
> A long time ago we had something similar happening, when a third-party
> component did not clean up thoroughly after itself. Our dialog would
> then latch onto the half-destroyed window of that third-party component
> as its parent window, and when events started being routed to that
> zombie window, our application crashed. Could something similar occur here?
Perhaps.
>
> Some hypotheses:
> - some remnants of wxPython window management live on, confusing Windows.
> - the ActiveScript session has not really terminated, so Python is still
> running, so wxPython has not been reclaimed by the GC, so it is actually
> still running its main-loop
> - our application still holds on to COM references which cause the
> ActiveScript session to continue to exist.
I've never investigated ActiveScript but something like #2 would be my
guess, with a little bit of #1 thrown in for good measure.
Can I assume that each script is creating an application object and
calling MainLoop? Does AS create new threads for these scripts to run
in or will they all be run in the same thread? If there is a way to
force them to use the same thread then I would try that. If there is a
way for you to cause AS to do more cleanup of the interpreter between
scripts then try that too. Finally, if there is some way to share a
single wx.App and MainLoop then that would be good too.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list