wierdness with pythonwin dialogs, threads & refcounts

Mark Hammond MHammond at skippinet.com.au
Thu Jun 17 18:28:24 EDT 1999


There could be a number of leaks in Pythonwin, but I dont think dialogs do.

The ref count is likely to be 6, as the pywin.mfc.Dialog base class hooks a
number of commands and messages.  Each of these hooks is a circular
reference, as a bound method is saved away.  These references are deleted
when a window recieves the WM_DESTROY message.

So in a nutshell, there is nothing obvious as to why the dialog is leaking.
The very first step would be to ensure it does not leak without threads.

Otherwise, it may come down to me tracking this down, as there are some
complicated interactions with MFC going on...

Finally, there is a "threadedGui.py" (or something) that should demonstrate
how to create "native Pythonwin threads".  However, now that we have the
threading module, there really isnt any real advantage to using Pythonwin
threads over threading.

Mark.

Dave Kirby wrote in message <3768b75e.5469224 at NNRP.UK.INSNET.NET>...
>
>I have found strange behaviour (strange to me at least) when creating
>a pythonwin dialog on a separate thread created using the standard







More information about the Python-list mailing list