File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ void define_guik(py::module_& m) {
287287 py::class_<guik::ProjectionControl, std::shared_ptr<guik::ProjectionControl>>(guik_, " ProjectionControl" );
288288
289289 // guik::Application
290- py::class_<guik::Application>(guik_, " Application" )
290+ py::class_<guik::Application, std::unique_ptr<guik::Application, py::nodelete> >(guik_, " Application" )
291291 .def (" ok" , &guik::Application::ok)
292292 .def (" enable_vsync" , &guik::Application::enable_vsync)
293293 .def (" disable_vsync" , &guik::Application::disable_vsync)
@@ -886,4 +886,10 @@ void define_guik(py::module_& m) {
886886 py::arg (" title" ) = " screen" );
887887 guik_.def (" async_destroy" , &guik::async_destroy, " " );
888888 guik_.def (" async_wait" , &guik::async_wait, " " );
889+
890+ auto atexit = py::module_::import (" atexit" );
891+ atexit.attr (" register" )(py::cpp_function ([]() {
892+ guik::async_destroy ();
893+ guik::destroy ();
894+ }));
889895}
You can’t perform that action at this time.
0 commit comments