Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pygeodiff/geodifflib.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ def __del__(self):
self.shutdown()

def shutdown(self):
if self.lib is not None:
lib = getattr(self, "lib", None)
if lib is not None:
Comment on lines +77 to +78

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is ugly... better to init self.lib = None in the __init__() instead of this

if platform.system() == "Windows":
from _ctypes import FreeLibrary

FreeLibrary(self.lib._handle)
FreeLibrary(lib._handle)
else:
from _ctypes import dlclose

dlclose(lib._handle)
self.lib = None

def _register_functions(self):
Expand Down
Loading