From 06588b7704a4bd41b558a0abe611f3490b6f17e6 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Thu, 9 Jun 2011 16:52:49 +0300 Subject: Add missing freeTexture() from fix for QTBUG-19180 Task-number: QTBUG-19180 Reviewed-by: TRUSTME --- src/opengl/qgl.cpp | 22 ++++++++++++++++++++++ src/opengl/qgl_p.h | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 6248cfe..4fee886 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -5902,4 +5902,26 @@ QSize QGLTexture::bindCompressedTexturePVR(const char *buf, int len) #undef ctx +#ifdef Q_OS_SYMBIAN +void QGLTexture::freeTexture() +{ + if (!id) + return; + + if (inTexturePool) + QGLTexturePool::instance()->detachTexture(this); + + if (boundPixmap) + boundPixmap->releaseNativeImageHandle(); + + if (options & QGLContext::MemoryManagedBindOption) { + Q_ASSERT(context); + context->d_ptr->texture_destroyer->emitFreeTexture(context, 0, id); + } + + id = 0; + boundKey = 0; +} +#endif + QT_END_NAMESPACE diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 2fb7e58..2ca8dc9 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -558,6 +558,9 @@ public: {} ~QGLTexture() { +#ifdef Q_OS_SYMBIAN + freeTexture(); +#else if (options & QGLContext::MemoryManagedBindOption) { Q_ASSERT(context); #if !defined(Q_WS_X11) @@ -565,6 +568,7 @@ public: #endif context->d_ptr->texture_destroyer->emitFreeTexture(context, boundPixmap, id); } +#endif } QGLContext *context; @@ -587,6 +591,8 @@ public: QSize bindCompressedTexturePVR(const char *buf, int len); #ifdef Q_OS_SYMBIAN + void freeTexture(); + QGLPixmapData* boundPixmap; qint64 boundKey; -- cgit v0.12