Fix `Event.__del__` behavior on shutdown`
@@ -97,7 +97,9 @@ class Event(object):
(interprocess and runtime.eventInterprocess))
self.ptr = runtime.eventCreateWithFlags(flag)
- def __del__(self):
+ def __del__(self, is_shutting_down=util.is_shutting_down):
+ if is_shutting_down():
+ return
if self.ptr:
runtime.eventDestroy(self.ptr)
