summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-11-24 21:08:56 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-11-26 05:50:14 +0000
commitc83eefff976a5f2cd673f6b4a95922b13855dd29 (patch)
tree5e26ee0afeb52d7fc69f43fd81b408f3356ccd01
parente4d1bf9829c56dc446a07689758f22c58863d70d (diff)
Remove incorrect assertion from the backingstore
The ifdef gave an impression of the code path being hit only when texture-backed widgets are present and OpenGL-based compositing is active. This is false. Asserting on having a context current is wrong (as shown by autotests on the 5.6 branch). Change-Id: I2539f0aac75b26597f49f63edcd9580428be79b7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp13
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
}