New submission from Pat Lynch <plync...@gmail.com>:

If I load a dll in ctypes, then delete that loaded DLL instance, the DLL is not 
unloaded until the script finishes and exits.

I'm trying to write some unit tests in python to exercise that DLL where each 
test case loads a DLL, does some work, then unloads the DLL.  Unfortunately the 
DLL only gets unloaded when the unit tests finish.

I've tried forcing the garbage collector to run to get the DLL to unload.  It 
did nothing...

# load the DLL
parser_dll = CDLL(dllpath)

# do some work here

# 'unload' the dll (or as close as I can get it to it)
if (parser_dll):
    del parser_dll

----------
components: ctypes
messages: 158433
nosy: plynch76
priority: normal
severity: normal
status: open
title: Cannot unload dll in ctypes until script exits
type: enhancement
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14597>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to