diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-20 10:34:22 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-20 10:38:50 (GMT) |
commit | f8fb064d6b2ad55c66ce1a481e7f829278051fcb (patch) | |
tree | f9757d37597cd9836a080c979899fd7a5417b49e /src/gui/kernel/qwidget.cpp | |
parent | 8fb9ed08c60b667737a9ae1b209da61fe9c67200 (diff) | |
download | Qt-f8fb064d6b2ad55c66ce1a481e7f829278051fcb.zip Qt-f8fb064d6b2ad55c66ce1a481e7f829278051fcb.tar.gz Qt-f8fb064d6b2ad55c66ce1a481e7f829278051fcb.tar.bz2 |
avoid possible crash when showing a modal dialog from a widget destructor
Task-number: QTBUG-5804
Reviewed-by: denis
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 709f6f3..fbb9115 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -8248,7 +8248,8 @@ bool QWidget::event(QEvent *event) QList<QObject*> childList = d->children; for (int i = 0; i < childList.size(); ++i) { QObject *o = childList.at(i); - QApplication::sendEvent(o, event); + if (o) + QApplication::sendEvent(o, event); } } update(); @@ -8277,7 +8278,7 @@ bool QWidget::event(QEvent *event) QList<QObject*> childList = d->children; for (int i = 0; i < childList.size(); ++i) { QObject *o = childList.at(i); - if (o != QApplication::activeModalWidget()) { + if (o && o != QApplication::activeModalWidget()) { if (qobject_cast<QWidget *>(o) && static_cast<QWidget *>(o)->isWindow()) { // do not forward the event to child windows, // QApplication does this for us |