summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgltexturepool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/qgltexturepool.cpp')
-rw-r--r--src/opengl/qgltexturepool.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/opengl/qgltexturepool.cpp b/src/opengl/qgltexturepool.cpp
index 61a88c3..a5472ec 100644
--- a/src/opengl/qgltexturepool.cpp
+++ b/src/opengl/qgltexturepool.cpp
@@ -135,8 +135,11 @@ void QGLTexturePool::releaseTexture(QGLPixmapData *data, GLuint texture)
if (data)
removeFromLRU(data);
- QGLShareContextScope ctx(qt_gl_share_widget()->context());
- glDeleteTextures(1, &texture);
+ QGLWidget *shareWidget = qt_gl_share_widget();
+ if (shareWidget) {
+ QGLShareContextScope ctx(shareWidget->context());
+ glDeleteTextures(1, &texture);
+ }
}
void QGLTexturePool::useTexture(QGLPixmapData *data)