pkbind::finalize is corrected

This commit is contained in:
Kyle Dayton 2025-05-18 20:13:17 -05:00 committed by GitHub
parent cd53a746f4
commit 5d3fc8541f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,15 +20,19 @@ inline void initialize(int object_pool_size = 1024) {
/// finalize the vm.
inline void finalize(bool test = false) {
if(!initialized) { return; }
object_pool::finalize();
type::m_type_map.clear();
capsule::tp_capsule.reset();
cpp_function::tp_function_record.reset();
if(test) {
py_resetvm();
} else {
py_finalize();
}
initialized = false;
}
/// a RAII class to initialize and finalize python interpreter