Merge pull request #231 from thinking-tower/bugfix/segfault-after-import-kp-and-exit
Set kp_debug, kp_info, kp_warning and kp_error to py::none() when the program terminates.
This commit is contained in:
commit
e77a684a20
1 changed files with 7 additions and 0 deletions
|
|
@ -235,6 +235,13 @@ PYBIND11_MODULE(kp, m) {
|
|||
return kp::py::vkPropertiesToDict(properties);
|
||||
}, "Return a dict containing information about the device");
|
||||
|
||||
auto atexit = py::module_::import("atexit");
|
||||
atexit.attr("register")(py::cpp_function([](){
|
||||
kp_debug = py::none();
|
||||
kp_info = py::none();
|
||||
kp_warning = py::none();
|
||||
kp_error = py::none();
|
||||
}));
|
||||
|
||||
#ifdef VERSION_INFO
|
||||
m.attr("__version__") = VERSION_INFO;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue