summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/twisted_main.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/gui/twisted_main.py')
-rw-r--r--src/leap/bitmask/gui/twisted_main.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/leap/bitmask/gui/twisted_main.py b/src/leap/bitmask/gui/twisted_main.py
index ece32ca2..f39d0bbe 100644
--- a/src/leap/bitmask/gui/twisted_main.py
+++ b/src/leap/bitmask/gui/twisted_main.py
@@ -22,9 +22,6 @@ import logging
from twisted.internet import error, reactor
from PySide import QtCore
-# Resist the temptation of putting the import reactor here,
-# it will raise an "reactor already imported" error.
-
logger = logging.getLogger(__name__)
@@ -32,7 +29,11 @@ def stop():
logger.debug("Really stoping all the things...")
QtCore.QCoreApplication.sendPostedEvents()
QtCore.QCoreApplication.flush()
- reactor.stop()
+ try:
+ reactor.stop()
+ logger.debug('Twisted reactor stopped')
+ except error.ReactorNotRunning:
+ logger.debug('Twisted reactor not running')
logger.debug("Done stopping all the things.")
@@ -43,8 +44,4 @@ def quit(app):
:param app: the main qt QApplication instance.
:type app: QtCore.QApplication
"""
- logger.debug('Stopping twisted reactor')
- try:
- reactor.callLater(0, stop)
- except error.ReactorNotRunning:
- logger.debug('Reactor not running')
+ reactor.callLater(0, stop)