[wxPython-users] calling wx.CallAfter after wx.Frame.Destroy

Aaron Brady castironpi at comcast.net
Tue Jan 22 21:43:06 PST 2008


> > > However, if you block on MyCallAfterFunction's turn in the event
> queue,
> > a
> > > previously posted and sunk event, which blocks on the same
> > synchronization
> > > object, halts the queue, deadlocking it.
> >
> > Well, yes.  However you could have that problem regardless of whether
> > the frame is being destroyed or not, or if MainLoop is exiting.
> >
> Note: CallAfter does not guarantee its parameter will be called.

Take a look,
http://home.comcast.net/~castironpi/callafterqueue.py
Output at [1].
An event loop using the Python stdlib's Queue object.  Provides spawn and
spawnfore, which callback and spawns new thread with result of callback,
respectively.


[1] Output
th done
f 0
f 100
f 1
f 101
f 2
f 102
f 3
f 103
f 4
f 104
f 5
f 105
f 6
f 106
f 7
f 107
f 8
f 108
f 9
f 109
f 1010
f 1001
f 1004
f 1009
f 1007
f 1007
f 1003
f 1005
f 1002
f 1008
queue return
spawn complete




More information about the wxpython-users mailing list