mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
pkbind::finalize is corrected
This commit is contained in:
parent
cd53a746f4
commit
5d3fc8541f
@ -20,15 +20,19 @@ inline void initialize(int object_pool_size = 1024) {
|
|||||||
/// finalize the vm.
|
/// finalize the vm.
|
||||||
inline void finalize(bool test = false) {
|
inline void finalize(bool test = false) {
|
||||||
if(!initialized) { return; }
|
if(!initialized) { return; }
|
||||||
|
|
||||||
object_pool::finalize();
|
object_pool::finalize();
|
||||||
type::m_type_map.clear();
|
type::m_type_map.clear();
|
||||||
capsule::tp_capsule.reset();
|
capsule::tp_capsule.reset();
|
||||||
cpp_function::tp_function_record.reset();
|
cpp_function::tp_function_record.reset();
|
||||||
|
|
||||||
if(test) {
|
if(test) {
|
||||||
py_resetvm();
|
py_resetvm();
|
||||||
} else {
|
} else {
|
||||||
py_finalize();
|
py_finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// a RAII class to initialize and finalize python interpreter
|
/// a RAII class to initialize and finalize python interpreter
|
||||||
@ -41,4 +45,4 @@ public:
|
|||||||
|
|
||||||
} // namespace pkbind
|
} // namespace pkbind
|
||||||
|
|
||||||
namespace pybind11 = pkbind;
|
namespace pybind11 = pkbind;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user