diff options
author | Yoann Lopes <yoann.lopes@digia.com> | 2014-05-23 15:54:05 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-03 12:51:27 +0200 |
commit | 6e9b406fefe7fe3147587d573f1763c906682f5e (patch) | |
tree | a18759af69f3dfdd2298859a604191b23868f404 /src/quick/scenegraph/qsgcontext.cpp | |
parent | f45fe58ad2aa741c90b756643da75f1a6bc2fdf6 (diff) |
Fix crash in QSGRenderContext::invalidate().
QSGRenderContext was holding pointers to QFontEngines without
increasing the font engine's ref count, allowing them to be deleted
before QSGRenderContext could make use of them.
Task-number: QTBUG-36573
Task-number: QTBUG-38313
Change-Id: I0ed28bb44882c55f330c27c23b533b7999d7e04b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quick/scenegraph/qsgcontext.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 64506d1c26..124316a92f 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -415,6 +415,7 @@ QSGRenderContext *QSGRenderContext::from(QOpenGLContext *context) void QSGRenderContext::registerFontengineForCleanup(QFontEngine *engine) { + engine->ref.ref(); m_fontEnginesToClean << engine; } @@ -493,6 +494,8 @@ void QSGRenderContext::invalidate() for (QSet<QFontEngine *>::const_iterator it = m_fontEnginesToClean.constBegin(), end = m_fontEnginesToClean.constEnd(); it != end; ++it) { (*it)->clearGlyphCache(m_gl); + if (!(*it)->ref.deref()) + delete *it; } m_fontEnginesToClean.clear(); |