diff --git a/src/python/magnum/platform/egl.cpp b/src/python/magnum/platform/egl.cpp index 56910e3..6d4a3c6 100644 --- a/src/python/magnum/platform/egl.cpp +++ b/src/python/magnum/platform/egl.cpp @@ -58,6 +58,10 @@ void egl(py::module& m) { #pragma GCC diagnostic pop #endif } + + /* The base doesn't have a virtual destructor because in C++ it's never + deleted through a pointer to the base. Here we need it, though. */ + virtual ~PyWindowlessApplication() {} }; py::class_ windowlessEglApplication{m, "WindowlessApplication", "Windowless EGL application"}; diff --git a/src/python/magnum/platform/glfw.cpp b/src/python/magnum/platform/glfw.cpp index 2dabd50..2003f74 100644 --- a/src/python/magnum/platform/glfw.cpp +++ b/src/python/magnum/platform/glfw.cpp @@ -45,6 +45,10 @@ void glfw(py::module& m) { void mousePressEvent(MouseEvent&) override {} void mouseReleaseEvent(MouseEvent&) override {} void mouseMoveEvent(MouseMoveEvent&) override {} + + /* The base doesn't have a virtual destructor because in C++ it's never + deleted through a pointer to the base. Here we need it, though. */ + virtual ~PublicizedApplication() {} }; struct PyApplication: PublicizedApplication { diff --git a/src/python/magnum/platform/glx.cpp b/src/python/magnum/platform/glx.cpp index 6307acc..6ae0b74 100644 --- a/src/python/magnum/platform/glx.cpp +++ b/src/python/magnum/platform/glx.cpp @@ -58,6 +58,10 @@ void glx(py::module& m) { #pragma GCC diagnostic pop #endif } + + /* The base doesn't have a virtual destructor because in C++ it's never + deleted through a pointer to the base. Here we need it, though. */ + virtual ~PyWindowlessApplication() {} }; py::class_ windowlessGlxApplication{m, "WindowlessApplication", "Windowless GLX application"}; diff --git a/src/python/magnum/platform/sdl2.cpp b/src/python/magnum/platform/sdl2.cpp index 4ec817f..2d3be7c 100644 --- a/src/python/magnum/platform/sdl2.cpp +++ b/src/python/magnum/platform/sdl2.cpp @@ -45,6 +45,10 @@ void sdl2(py::module& m) { void mousePressEvent(MouseEvent&) override {} void mouseReleaseEvent(MouseEvent&) override {} void mouseMoveEvent(MouseMoveEvent&) override {} + + /* The base doesn't have a virtual destructor because in C++ it's never + deleted through a pointer to the base. Here we need it, though. */ + virtual ~PublicizedApplication() {} }; struct PyApplication: PublicizedApplication {