diff options
Diffstat (limited to 'python/pluginmanager.py')
| -rw-r--r-- | python/pluginmanager.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/pluginmanager.py b/python/pluginmanager.py index aa68a4f3..0e5c4c97 100644 --- a/python/pluginmanager.py +++ b/python/pluginmanager.py @@ -37,7 +37,8 @@ class RepoPlugin: self.handle = core.handle_of_type(handle, core.BNRepoPlugin) def __del__(self): - core.BNFreePlugin(self.handle) + if core is not None: + core.BNFreePlugin(self.handle) def __repr__(self): return "<{} {}/{}>".format(self.path, "installed" if self.installed else "not-installed", "enabled" if self.enabled else "disabled") @@ -263,7 +264,8 @@ class Repository: self.handle = core.handle_of_type(handle, core.BNRepository) def __del__(self): - core.BNFreeRepository(self.handle) + if core is not None: + core.BNFreeRepository(self.handle) def __repr__(self): return "<{}>".format(self.path) |
