Do not crash when receiving an object we no longer need
This commit is contained in:
parent
ef2b3bba0a
commit
ca5a489d2c
|
@ -293,8 +293,8 @@ class Connection(threading.Thread):
|
||||||
elif m.command == b'object':
|
elif m.command == b'object':
|
||||||
obj = structure.Object.from_message(m)
|
obj = structure.Object.from_message(m)
|
||||||
logging.debug('{}:{} -> {}'.format(self.host_print, self.port, obj))
|
logging.debug('{}:{} -> {}'.format(self.host_print, self.port, obj))
|
||||||
del self.vectors_requested[obj.vector]
|
self.vectors_requested.pop(obj.vector, None)
|
||||||
self.vectors_to_get.remove(obj.vector)
|
self.vectors_to_get.discard(obj.vector)
|
||||||
if obj.is_valid() and obj.vector not in shared.objects:
|
if obj.is_valid() and obj.vector not in shared.objects:
|
||||||
with shared.objects_lock:
|
with shared.objects_lock:
|
||||||
shared.objects[obj.vector] = obj
|
shared.objects[obj.vector] = obj
|
||||||
|
|
Loading…
Reference in New Issue
Block a user