Skip to content

Commit e32736b

Browse files
committed
dereference zmq_msg_t in dealloc, not del
dealloc always runs exactly once, del is less reliable (and doesn't run at all for limited api)
1 parent 11e3dd6 commit e32736b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zmq/backend/cython/_zmq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@ def __init__(
367367
_check_rc(rc)
368368
self._failed_init = False
369369

370-
def __del__(self):
370+
def __dealloc__(self):
371371
if self._failed_init:
372372
return
373-
# This simply decreases the 0MQ ref-count of zmq_msg.
373+
# decrease the 0MQ ref-count of zmq_msg
374374
with nogil:
375375
rc: C.int = zmq_msg_close(address(self.zmq_msg))
376376
_check_rc(rc)

0 commit comments

Comments
 (0)