summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-03-17 11:44:58 -0300
committerTomás Touceda <chiiph@leap.se>2014-03-17 11:44:58 -0300
commitc0ac189e565c9cfc453db4d1ef77cc4c48f17584 (patch)
tree2cfc10371e4dba5cdde021ffb87a1aec4d4526c9 /src
parent036392269c30ca3468225d8aa4fc1540629071ec (diff)
parenta2e2356ff0d740441b3431be0a2e095940412b2a (diff)
Merge remote-tracking branch 'refs/remotes/kali/bug/catch-shutdown-errors' into develop
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/backend.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/leap/bitmask/backend.py b/src/leap/bitmask/backend.py
index 34457e34..99e5a04b 100644
--- a/src/leap/bitmask/backend.py
+++ b/src/leap/bitmask/backend.py
@@ -325,7 +325,8 @@ class Backend(object):
Stops the looping call and tries to cancel all the defers.
"""
log.msg("Stopping worker...")
- self._lc.stop()
+ if self._lc.running:
+ self._lc.stop()
while len(self._ongoing_defers) > 0:
d = self._ongoing_defers.pop()
d.cancel()
@@ -392,7 +393,8 @@ class Backend(object):
:param d: defer to remove
:type d: twisted.internet.defer.Deferred
"""
- self._ongoing_defers.remove(d)
+ if d in self._ongoing_defers:
+ self._ongoing_defers.remove(d)
# XXX: Temporal interface until we migrate to zmq
# We simulate the calls to zmq.send_multipart. Once we separate