summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-11-12 17:26:21 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-11-23 08:31:53 +0000
commit5a48d1d164ba507469ee1a8a682a3c194d733890 (patch)
treea2ccfb485a17b63fccf777cb81bb755f7361f631 /src/gui
parentfe4ab7edce3863a23d5871634d93f0b855aa93ac (diff)
Do not leak textures from the backing stores
Neither the default nor the eglfs-specific backingstore release the OpenGL textures that are in use when render-to-texture widgets are involved. The result can be fatal on embedded devices that run out of GPU memory at after showing and closing dialogs and popups a certain number of times. Task-number: QTBUG-49363 Task-number: QTBUG-49399 Change-Id: Ia7471b037f147bcca0a4f1db5808ca348e230547 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index 62492980de..70ab9825e9 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -65,6 +65,10 @@ public:
~QPlatformBackingStorePrivate()
{
#ifndef QT_NO_OPENGL
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ Q_ASSERT(ctx);
+ if (textureId)
+ ctx->functions()->glDeleteTextures(1, &textureId);
if (blitter)
blitter->destroy();
delete blitter;