samskalicky commented on pull request #6292:
URL: https://github.com/apache/incubator-tvm/pull/6292#issuecomment-675623678


   Since this is definitely something out of our control (shutdown order, 
varies depending on application usage) and we've decided to rely on the process 
exiting to free any memory, can we consider clearing the pointers in 
`DeviceAPIManager` like:
   ```
     // destructor
     ~DeviceAPIManager() { std::fill(api_.begin(), api_.end(), nullptr); }
   ```
   And then just make sure that wherever we try and get the `DeviceAPI` that we 
check to see if the pointer is null? Then we just skip freeing any memory and 
dont have to worry about objects destructed out of order


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to