summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLasse Holmstedt <lasse.holmstedt@nokia.com>2011-03-04 00:34:57 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2011-03-04 00:34:57 (GMT)
commitd893ad027570ae7b3127636a4622f9cb4d5bb7a0 (patch)
tree9a87def8c066ebd5f9fc2b7222491f806edc7523 /src
parent9c1549371e86c95e08f7fc2e11242de12fb1e1da (diff)
downloadQt-d893ad027570ae7b3127636a4622f9cb4d5bb7a0.zip
Qt-d893ad027570ae7b3127636a4622f9cb4d5bb7a0.tar.gz
Qt-d893ad027570ae7b3127636a4622f9cb4d5bb7a0.tar.bz2
Fix potential crash in QTextControl.
inputContext() is only safe to call if there is a current contextWidget. Change-Id: I6cbccf5f5fbb2d8c9ca6acf5f7e02f680eb84483 Reviewed-by: Andrew den Exter
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qtextcontrol.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index b25588d..f4054d3 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1649,8 +1649,10 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
emit q->cursorPositionChanged();
_q_updateCurrentCharFormatAndSelection();
#ifndef QT_NO_IM
- if (QInputContext *ic = inputContext()) {
- ic->update();
+ if (contextWidget) {
+ if (QInputContext *ic = inputContext()) {
+ ic->update();
+ }
}
#endif //QT_NO_IM
} else {