Permalink
Browse files

Merge pull request #63 from IGITUGraz/FixingMemLeak

BUGFIX: Incorrect deletion from set 'inprogress'
  • Loading branch information...
soravux committed Jun 7, 2017
2 parents b700f5c + eda6e08 commit d391dfa62f47e49d48328ee9cf08aa114256fd33
Showing with 8 additions and 1 deletion.
  1. +8 −1 scoop/_types.py
View
@@ -105,6 +105,13 @@ def __lt__(self, other):
"""Order futures by creation time."""
return self.creationTime < other.creationTime
+ def __eq__(self, other):
+ # This uses he fact that id's are unique
+ return self.id == other.id
+
+ def __hash__(self):
+ return hash(self.id)
+
def __repr__(self):
"""Convert future to string."""
try:
@@ -246,7 +253,7 @@ def _execute_callbacks(self, callbackType=CallbackType.standard):
def _delete(self):
# TODO: Do we need this?
# discard: remove if exists
- scoop._control.execQueue.inprogress.discard(self.id)
+ scoop._control.execQueue.inprogress.discard(self)
for child in self.children:
child.exceptionValue = CancelledError()
scoop._control.delFuture(self)

0 comments on commit d391dfa

Please sign in to comment.