diff options
Diffstat (limited to 'module/FileDatabase.py')
-rw-r--r-- | module/FileDatabase.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/module/FileDatabase.py b/module/FileDatabase.py index 80613db30..373e4e571 100644 --- a/module/FileDatabase.py +++ b/module/FileDatabase.py @@ -936,9 +936,10 @@ class PyFile(): def initPlugin(self): """ inits plugin instance """ - self.pluginmodule = self.m.core.pluginManager.getPlugin(self.pluginname) - self.pluginclass = getattr(self.pluginmodule, self.pluginname) - self.plugin = self.pluginclass(self) + if not self.plugin: + self.pluginmodule = self.m.core.pluginManager.getPlugin(self.pluginname) + self.pluginclass = getattr(self.pluginmodule, self.pluginname) + self.plugin = self.pluginclass(self) def package(self): @@ -959,6 +960,8 @@ class PyFile(): def release(self): """sync and remove from cache""" self.sync() + if hasattr(self, "plugin"): + del self.plugin self.m.releaseLink(self.id) def delete(self): |