Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mydll = ctypes.CDLL('...')
- del mydll
- mydll = ctypes.CDLL('...')
- mydll = ctypes.CDLL('./mylib.so')
- handle = mydll._handle
- del mydll
- while isLoaded('./mylib.so'):
- dlclose(handle)
- def isLoaded(lib):
- libp = os.path.abspath(lib)
- ret = os.system("lsof -p %d | grep %s > /dev/null" % (os.getpid(), libp))
- return (ret == 0)
- def dlclose(handle)
- libdl = ctypes.CDLL("libdl.so")
- libdl.dlclose(handle)
Add Comment
Please, Sign In to add comment