junrushao commented on code in PR #593:
URL: https://github.com/apache/tvm-ffi/pull/593#discussion_r3320141626
##########
python/tvm_ffi/cython/object.pxi:
##########
@@ -102,10 +102,10 @@ cdef class CObject:
# case of error before chandle is set
self.chandle = NULL
- def __dealloc__(self):
- if self.chandle != NULL:
- CHECK_CALL(TVMFFIObjectDecRef(self.chandle))
- self.chandle = NULL
+ def __del__(self):
Review Comment:
Let's double check and test it out, making sure this `__del__` method will
be properly invoked. I had some really negative experience with overloading
`__del__` because it could possibly prevent Python GC from recycling memory in
certain cases. Not 100% sure if it applies to Cython's `cdef class`'s `__del__`
method though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]