| 31 | { |
| 32 | public: |
| 33 | Cleanup() |
| 34 | { |
| 35 | NVCV_ASSERT(m_instance == nullptr && "Only one instance of Cleanup can be instantiated"); |
| 36 | m_instance = this; |
| 37 | |
| 38 | // Functions registered with python's atexit will be executed after |
| 39 | // the script ends without fatal errors, but before python interpreter is torn down. |
| 40 | // That's a good place for our cleanup. |
| 41 | auto py_atexit = py::module_::import("atexit"); |
| 42 | py_atexit.attr("register")(py::cpp_function(&doCleanup)); |
| 43 | } |
| 44 | |
| 45 | ~Cleanup() |
| 46 | { |
nothing calls this directly
no outgoing calls
no test coverage detected