EditorAssembly: added a guard against shutdownTimer() being called multiple times.

Sat, 02 Jun 2018 12:34:47 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 02 Jun 2018 12:34:47 +0200
changeset 6317
e9ec47d52ff2
parent 6316
ee88310f0334
child 6318
17df7a729d94

EditorAssembly: added a guard against shutdownTimer() being called multiple times.

QScintilla/EditorAssembly.py file | annotate | diff | comparison | revisions
diff -r ee88310f0334 -r e9ec47d52ff2 QScintilla/EditorAssembly.py
--- a/QScintilla/EditorAssembly.py	Sat Jun 02 12:19:27 2018 +0200
+++ b/QScintilla/EditorAssembly.py	Sat Jun 02 12:34:47 2018 +0200
@@ -60,6 +60,7 @@
         self.__membersCombo.activated[int].connect(self.__membersActivated)
         self.__editor.cursorLineChanged.connect(self.__editorCursorLineChanged)
         
+        self.__shutdownTimerCalled = False
         self.__parseTimer = QTimer(self)
         self.__parseTimer.setSingleShot(True)
         self.__parseTimer.setInterval(5 * 1000)
@@ -79,9 +80,11 @@
         Public method to stop and disconnect the timer.
         """
         self.__parseTimer.stop()
-        self.__parseTimer.timeout.disconnect(self.__parseEditor)
-        self.__editor.textChanged.disconnect(self.__resetParseTimer)
-        self.__editor.refreshed.disconnect(self.__resetParseTimer)
+        if not self.__shutdownTimerCalled:
+            self.__parseTimer.timeout.disconnect(self.__parseEditor)
+            self.__editor.textChanged.disconnect(self.__resetParseTimer)
+            self.__editor.refreshed.disconnect(self.__resetParseTimer)
+            self.__shutdownTimerCalled = True
     
     def getEditor(self):
         """

eric ide

mercurial