File tree Expand file tree Collapse file tree 4 files changed +5
-18
lines changed
Expand file tree Collapse file tree 4 files changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ cdef class UVHandle:
2424
2525 cdef _warn_unclosed(self )
2626
27- cdef _dealloc_impl(self )
2827 cdef _free(self )
2928 cdef _close(self )
3029
Original file line number Diff line number Diff line change @@ -26,9 +26,6 @@ cdef class UVHandle:
2626 self .__class__.__name__ ))
2727
2828 def __dealloc__ (self ):
29- self ._dealloc_impl()
30-
31- cdef _dealloc_impl(self ):
3229 if UVLOOP_DEBUG:
3330 if self ._loop is not None :
3431 self ._loop._debug_handles_current.subtract([
@@ -40,9 +37,6 @@ cdef class UVHandle:
4037 .format(self .__class__.__name__ ))
4138
4239 if self ._handle is NULL :
43- if UVLOOP_DEBUG:
44- if self ._has_handle == 0 :
45- self ._loop._debug_uv_handles_freed += 1
4640 return
4741
4842 # -> When we're at this point, something is wrong <-
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ cdef class UVProcess(UVHandle):
190190 ' UVProcess._close_after_spawn called after uv_spawn' )
191191 self ._fds_to_close.add(fd)
192192
193- cdef _dealloc_impl (self ):
193+ def __dealloc__ (self ):
194194 if self .uv_opt_env is not NULL :
195195 PyMem_RawFree(self .uv_opt_env)
196196 self .uv_opt_env = NULL
@@ -199,8 +199,6 @@ cdef class UVProcess(UVHandle):
199199 PyMem_RawFree(self .uv_opt_args)
200200 self .uv_opt_args = NULL
201201
202- UVHandle._dealloc_impl(self )
203-
204202 cdef char ** __to_cstring_array(self , list arr):
205203 cdef:
206204 int i
Original file line number Diff line number Diff line change @@ -100,18 +100,14 @@ cdef class UDPTransport(UVBaseTransport):
100100 udp._init(loop, sock, r_addr)
101101 return udp
102102
103- cdef _dealloc_impl(self ):
103+ def __dealloc__ (self ):
104+ if UVLOOP_DEBUG:
105+ self ._loop._debug_uv_handles_freed += 1
106+
104107 if self ._closed == 0 :
105108 self ._warn_unclosed()
106109 self ._close()
107110
108- # It is unsafe to call `self.poll._close()` here as
109- # we might be at the stage where all CPython objects
110- # are being freed, and `self.poll` points to some
111- # zombie Python object. So we do nothing.
112-
113- UVHandle._dealloc_impl(self )
114-
115111 cdef _free(self ):
116112 if self .poll is not None :
117113 self .poll._close()
You can’t perform that action at this time.
0 commit comments