diff options
Diffstat (limited to 'src/opengl/qpixmapdata_gl.cpp')
-rw-r--r-- | src/opengl/qpixmapdata_gl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 5e73ef5..f745aae 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -114,8 +114,11 @@ QGLPixmapData::~QGLPixmapData() QGLWidget *shareWidget = qt_gl_share_widget(); if (!shareWidget) return; - QGLShareContextScope ctx(shareWidget->context()); - glDeleteTextures(1, &m_textureId); + + if (m_textureId) { + QGLShareContextScope ctx(shareWidget->context()); + glDeleteTextures(1, &m_textureId); + } } bool QGLPixmapData::isValid() const |