diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index ae2f459931..b72e355626 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -1053,5 +1053,11 @@ bool GLPlatform::isGLES() const #endif } +void GLPlatform::cleanup() +{ + delete s_platform; + s_platform = nullptr; +} + } // namespace KWin diff --git a/libkwineffects/kwinglplatform.h b/libkwineffects/kwinglplatform.h index 66050762a3..1001745dad 100644 --- a/libkwineffects/kwinglplatform.h +++ b/libkwineffects/kwinglplatform.h @@ -337,6 +337,8 @@ public: private: GLPlatform(); + friend void KWin::cleanupGL(); + static void cleanup(); private: QByteArray m_renderer; diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index 881e13528f..0bf4c11e6c 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -137,6 +137,7 @@ void cleanupGL() { ShaderManager::cleanup(); GLVertexBuffer::cleanup(); + GLPlatform::cleanup(); } bool hasGLVersion(int major, int minor, int release)