Fix remove torrent lock-up issue.

This commit is contained in:
Andrew Resch 2007-06-28 08:16:12 +00:00
commit 9e5e6ddfb9

View file

@ -489,6 +489,14 @@ class Manager:
def handle_events(self): def handle_events(self):
# Handle them for the backend's purposes, but still send them up in case the client # Handle them for the backend's purposes, but still send them up in case the client
# wants to do something - show messages, for example # wants to do something - show messages, for example
def pop_event():
try:
return deluge_core.pop_event()
except:
pass
else:
return deluge_core.pop_event()
ret = [] ret = []
try: try:
event = deluge_core.pop_event() event = deluge_core.pop_event()
@ -499,6 +507,13 @@ class Manager:
# print "EVENT: ", event # print "EVENT: ", event
ret.append(event) ret.append(event)
try:
if event['unique_ID'] not in self.unique_IDs:
event = pop_event()
continue
except KeyError:
event = pop_event()
continue
if event['event_type'] is self.constants['EVENT_FINISHED']: if event['event_type'] is self.constants['EVENT_FINISHED']:
# Queue seeding torrent to bottom if needed # Queue seeding torrent to bottom if needed
@ -531,13 +546,7 @@ class Manager:
"tracker_messages", "tracker_messages",
new) new)
event = pop_event()
try:
event = deluge_core.pop_event()
except:
pass
else:
event = deluge_core.pop_event()
return ret return ret