Fixed an issue in the UserInterface that could cause a QNetworkReply object being of type E5Action (weird thing, probably a memory corruption issue). 6_0_x

Tue, 31 Mar 2015 18:52:04 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 31 Mar 2015 18:52:04 +0200
branch
6_0_x
changeset 4196
e4016f53ad26
parent 4194
092e5b213ace
child 4198
417706a8fddb

Fixed an issue in the UserInterface that could cause a QNetworkReply object being of type E5Action (weird thing, probably a memory corruption issue).
(grafted from f504f89eb11e6b6c040ea8891a2b0ba7fe3ce90b)

UI/UserInterface.py file | annotate | diff | comparison | revisions
diff -r 092e5b213ace -r e4016f53ad26 UI/UserInterface.py
--- a/UI/UserInterface.py	Mon Mar 30 19:17:30 2015 +0200
+++ b/UI/UserInterface.py	Tue Mar 31 18:52:04 2015 +0200
@@ -5902,14 +5902,23 @@
             return
         
         reply = self.sender()
+        
+        # This is a hack because sometimes reply is not a QNetworkReply
+        if not isinstance(reply, QNetworkReply):
+            if reply in self.__replies:
+                self.__replies.remove(reply)
+            return
+        
+        reply.deleteLater()
         if reply in self.__replies:
             self.__replies.remove(reply)
         if reply.error() == QNetworkReply.NoError:
             ioEncoding = Preferences.getSystem("IOEncoding")
             versions = str(reply.readAll(), ioEncoding, 'replace').splitlines()
+        reply.close()
         if reply.error() != QNetworkReply.NoError or \
-           len(versions) == 0 or \
-           versions[0].startswith("<"):
+            len(versions) == 0 or \
+                versions[0].startswith("<"):
             # network error or an error page
             self.httpAlternative += 1
             if self.httpAlternative >= len(self.__httpAlternatives):

eric ide

mercurial