summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/FileDatabase.py9
-rwxr-xr-xmodule/network/Request.py2
-rw-r--r--module/plugins/Plugin.py6
3 files changed, 14 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):
diff --git a/module/network/Request.py b/module/network/Request.py
index bc62a0cc9..14c9f0a7a 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -393,6 +393,8 @@ class Request:
def __del__(self):
self.clean()
+ if hasattr(self, "pycurl"):
+ del self.pycurl
def clean(self):
try:
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 00cb2401f..0df3519fc 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -114,6 +114,12 @@ class Plugin(object):
def __call__(self):
return self.__name__
+ def __del__(self):
+ if hasattr(self, "pyfile"):
+ del self.pyfile
+ if hasattr(self, "req"):
+ del self.req
+
def setup(self):
""" more init stuff if needed """
pass