diff --git a/olcPixelGameEngine.h b/olcPixelGameEngine.h index 5e59a87a..47f99c61 100644 --- a/olcPixelGameEngine.h +++ b/olcPixelGameEngine.h @@ -5320,6 +5320,15 @@ namespace olc #endif public: +#if defined(OLC_PLATFORM_X11) + // cpt -- free memory for VisualInfo + ~Renderer_OGL10() { + if (olc_VisualInfo) { + X11::XFree(olc_VisualInfo); + olc_VisualInfo = nullptr; + } + } +#endif void PrepareDevice() override { #if defined(OLC_PLATFORM_GLUT)