summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-15 00:56:37 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-15 00:56:37 (GMT)
commitec6777f809983a80f3258417769afd495a834b43 (patch)
tree751ffafc3570ef37eeb591057c70622fb75f5380 /src
parent05eb27a2007ebc1cae40c6331ee8b4d2fb76c1d9 (diff)
parentcb764eaf91e3a8ef30b280671d5c991ec926d14c (diff)
downloadQt-ec6777f809983a80f3258417769afd495a834b43.zip
Qt-ec6777f809983a80f3258417769afd495a834b43.tar.gz
Qt-ec6777f809983a80f3258417769afd495a834b43.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Prevent crash in QGLGlyphCache due to dangling context references.
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qpaintengine_opengl.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index fc31548..5c3ea58 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -4737,9 +4737,11 @@ void QGLGlyphCache::cacheGlyphs(QGLContext *context, const QTextItemInt &ti,
font_cache = new QGLFontGlyphHash;
// qDebug() << "new context" << context << font_cache;
qt_context_cache.insert(context, font_cache);
- if (context->isValid() && context->device()->devType() == QInternal::Widget) {
- QWidget *widget = static_cast<QWidget *>(context->device());
- connect(widget, SIGNAL(destroyed(QObject*)), SLOT(widgetDestroyed(QObject*)));
+ if (context->isValid()) {
+ if (context->device()->devType() == QInternal::Widget) {
+ QWidget *widget = static_cast<QWidget *>(context->device());
+ connect(widget, SIGNAL(destroyed(QObject*)), SLOT(widgetDestroyed(QObject*)));
+ }
connect(QGLSignalProxy::instance(),
SIGNAL(aboutToDestroyContext(const QGLContext*)),
SLOT(cleanupContext(const QGLContext*)));