summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-01-23 23:15:37 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-01-23 23:15:37 +0100
commitd66bfc3f0754d2b563d30ac3e6e7b55f2fdefdf7 (patch)
treeddbd7d825830e41b6403817701d29777189b275a
parentFileSonic Premium (diff)
downloadpyload-d66bfc3f0754d2b563d30ac3e6e7b55f2fdefdf7.tar.xz
closed memory leak in debug mode, closed #217
-rw-r--r--module/CaptchaManager.py7
-rw-r--r--module/PluginThread.py4
-rw-r--r--module/network/HTTPRequest.py2
-rw-r--r--module/plugins/Plugin.py2
4 files changed, 13 insertions, 2 deletions
diff --git a/module/CaptchaManager.py b/module/CaptchaManager.py
index d6a8fd077..d9e3748d7 100644
--- a/module/CaptchaManager.py
+++ b/module/CaptchaManager.py
@@ -83,7 +83,12 @@ class CaptchaTask():
self.lock.release()
def getResult(self):
- return self.result
+ try:
+ res = self.result.encode("utf8", "replace")
+ except:
+ res = self.result
+
+ return res
def getID(self):
return self.id
diff --git a/module/PluginThread.py b/module/PluginThread.py
index 216f59853..311d80ba4 100644
--- a/module/PluginThread.py
+++ b/module/PluginThread.py
@@ -71,6 +71,10 @@ class PluginThread(Thread):
dump += pformat(value) + "\n"
except Exception, e:
dump += "<ERROR WHILE PRINTING VALUE> "+ str(e) +"\n"
+
+ del frame
+
+ del stack #delete it just to be sure...
dump += "\n\nPLUGIN OBJECT DUMP: \n\n"
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py
index ebb3c3177..fe4a577b6 100644
--- a/module/network/HTTPRequest.py
+++ b/module/network/HTTPRequest.py
@@ -65,7 +65,7 @@ class HTTPRequest():
self.c.setopt(pycurl.AUTOREFERER, 1)
self.c.setopt(pycurl.SSL_VERIFYPEER, 0)
self.c.setopt(pycurl.LOW_SPEED_TIME, 30)
- self.c.setopt(pycurl.LOW_SPEED_LIMIT, 100)
+ self.c.setopt(pycurl.LOW_SPEED_LIMIT, 5)
#self.c.setopt(pycurl.VERBOSE, 1)
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index e237d52c8..f66a53bdc 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -294,6 +294,8 @@ class Plugin(object):
makedirs(join("tmp", self.__name__))
f = open(join("tmp", self.__name__, "%s_line%s.dump.html" % (frame.f_back.f_code.co_name, frame.f_back.f_lineno)), "wb")
+ del frame # delete the frame or it wont be cleaned
+
try:
tmp = res.encode("utf8")
except: