diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 25 | ||||
-rw-r--r-- | src/gui/opengl/qopenglpaintengine.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qtextureglyphcache.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qfontengineglyphcache_p.h | 3 |
4 files changed, 23 insertions, 9 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index f16f29718d..96b09342c7 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -759,15 +759,26 @@ void QOpenGLContextGroupPrivate::removeContext(QOpenGLContext *ctx) { Q_Q(QOpenGLContextGroup); - QMutexLocker locker(&m_mutex); - m_shares.removeOne(ctx); + bool deleteObject = false; + + { + QMutexLocker locker(&m_mutex); + m_shares.removeOne(ctx); - if (ctx == m_context && !m_shares.isEmpty()) - m_context = m_shares.first(); + if (ctx == m_context && !m_shares.isEmpty()) + m_context = m_shares.first(); + + if (!m_refs.deref()) { + cleanup(); + deleteObject = true; + } + } - if (!m_refs.deref()) { - cleanup(); - q->deleteLater(); + if (deleteObject) { + if (q->thread() == QThread::currentThread()) + delete q; // Delete directly to prevent leak, refer to QTBUG-29056 + else + q->deleteLater(); } } diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index 6238564eeb..2a8902adbf 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -877,7 +877,7 @@ void QOpenGL2PaintEngineExPrivate::fill(const QVectorPath& path) // Tag it for later so that if the same path is drawn twice, it is assumed to be static and thus cachable path.makeCacheable(); - if (device->context()->format().stencilBufferSize() == 0) { + if (device->context()->format().stencilBufferSize() <= 0) { // If there is no stencil buffer, triangulate the path instead. QRectF bbox = path.controlPointRect(); diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 43243b7c34..a9d5e21b50 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -305,6 +305,8 @@ void QImageTextureGlyphCache::createTextureData(int width, int height) case QFontEngineGlyphCache::Raster_RGBMask: m_image = QImage(width, height, QImage::Format_RGB32); break; + case QFontEngineGlyphCache::Raster_ARGB: + break; } } diff --git a/src/gui/text/qfontengineglyphcache_p.h b/src/gui/text/qfontengineglyphcache_p.h index 18440f22fa..092873a4d4 100644 --- a/src/gui/text/qfontengineglyphcache_p.h +++ b/src/gui/text/qfontengineglyphcache_p.h @@ -69,7 +69,8 @@ public: enum Type { Raster_RGBMask, Raster_A8, - Raster_Mono + Raster_Mono, + Raster_ARGB }; QFontEngineGlyphCache(const QTransform &matrix, Type type) : m_transform(matrix), m_type(type) { } |