diff options
Diffstat (limited to 'src/gui/painting/qplatformbackingstore.cpp')
-rw-r--r-- | src/gui/painting/qplatformbackingstore.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp index 70ab9825e9..22f5662c34 100644 --- a/src/gui/painting/qplatformbackingstore.cpp +++ b/src/gui/painting/qplatformbackingstore.cpp @@ -66,11 +66,14 @@ public: { #ifndef QT_NO_OPENGL QOpenGLContext *ctx = QOpenGLContext::currentContext(); - Q_ASSERT(ctx); - if (textureId) - ctx->functions()->glDeleteTextures(1, &textureId); - if (blitter) - blitter->destroy(); + if (ctx) { + if (textureId) + ctx->functions()->glDeleteTextures(1, &textureId); + if (blitter) + blitter->destroy(); + } else if (textureId || blitter) { + qWarning("No context current during QPlatformBackingStore destruction, OpenGL resources not released"); + } delete blitter; #endif } |