scene: Avoid changing current opengl context if the shadow has no texture

If there's nothing to be destroyed, do nothing.
This commit is contained in:
Vlad Zahorodnii 2023-03-31 09:40:33 +03:00
parent fd5807ecb7
commit 072d5ff045

View file

@ -174,9 +174,8 @@ OpenGLShadowTextureProvider::OpenGLShadowTextureProvider(Shadow *shadow)
OpenGLShadowTextureProvider::~OpenGLShadowTextureProvider()
{
WorkspaceScene *scene = Compositor::self()->scene();
if (scene) {
scene->makeOpenGLContextCurrent();
if (m_texture) {
Compositor::self()->scene()->makeOpenGLContextCurrent();
DecorationShadowTextureCache::instance().unregister(this);
m_texture.reset();
}