summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-10-15 16:45:13 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-10-15 20:03:51 (GMT)
commit8ef83e60df0291ba2a36cc744e1f0c11f465f1e2 (patch)
tree15c5e1d40451e5a3a6cb81bc972a4a88fdfeff46 /src
parentbdc951eb87e0b1aa752d3ec750cfd837714bd8b7 (diff)
downloadQt-8ef83e60df0291ba2a36cc744e1f0c11f465f1e2.zip
Qt-8ef83e60df0291ba2a36cc744e1f0c11f465f1e2.tar.gz
Qt-8ef83e60df0291ba2a36cc744e1f0c11f465f1e2.tar.bz2
Fixed a rare crash in qt_x11_enforce_cursor
A QPointer was set to point to a QWidget by one of its children, during its deletion. This happens during the child deletion, and after the call to QObject::clearGuards(), which means that the QPointer becomes a dangling one. The fix ensures that qt_x11_enforce_cursor will not be called with a being-deleted QWidget. The included auto-test doesn't test anything, except that it doesn't crash. Reviewed-by: Olivier
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qapplication.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index b990fe2..5476e36 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -2662,7 +2662,10 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) {
if (!isAlien(w))
break;
if (w->testAttribute(Qt::WA_SetCursor)) {
- parentOfLeavingCursor = w->parentWidget();
+ QWidget *parent = w->parentWidget();
+ while (parent && parent->d_func()->data.in_destructor)
+ parent = parent->parentWidget();
+ parentOfLeavingCursor = parent;
//continue looping, we need to find the downest alien widget with a cursor.
// (downest on the screen)
}