[python-win32] Re: [Py2exe-users] DllUnregister Question.

Mark Hammond mhammond at skippinet.com.au
Fri Oct 8 00:57:40 CEST 2004


> I looked that up, and indeed, MS doesn't recommend you call
> LoadLibrary
> or FreeLibrary in DllMain.  So my next suggestion is to call it in
> DllUnregisterServer.  Specifically, DllUnregisterServer calls
> check_init, which calls load_pythoncom, which calls LoadLibraryEx.  I
> suggest that we add a check_deinit() method, to be called
> just before we
> return, which calls unload_pythoncom, which calls FreeLibrary.

*Every* DLL used by the program must be unloaded - that includes
Pythonxx.dll and all the .pyd files used by Python.  Python simply doesn't
clean up after itself that well.

Mark



More information about the Python-win32 mailing list