tqchen commented on issue #457:
URL: https://github.com/apache/tvm-ffi/issues/457#issuecomment-3915323361

   To break down things a bit. Note that because deleter is a C function, the 
default contract here is that it is noexcept. Because destructor exception 
handling usually leads to issues("Double Exception" in c++). 
   
   The common practice in c++ is to: (a) each destructor ensure that it is no 
except(unless explicitly marked); (b) when there is a need to cleanup 
resources, have a clear context manager class that close resources, and catch 
exception inside if needed. Because the possibility of double exceptions, 
usually destructor exception handling would amounts to abort.
   
   So following this practice, when an Any holds ObjectRef that may hold 
resource (say we have a ProcessObject), it is the responsibility of the 
ProcessObject to ensure its dtor is exception free, which means try catch 
happens at the dtor of `ProcessObject` if it involves closure
   
   
   


-- 
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]

Reply via email to