diff -r fcece45ef507 -r 79de32ba3296 src/gui/kernel/qwidget.cpp --- a/src/gui/kernel/qwidget.cpp Mon May 03 13:17:34 2010 +0300 +++ b/src/gui/kernel/qwidget.cpp Fri May 14 16:40:13 2010 +0300 @@ -1487,8 +1487,12 @@ if (QWidgetPrivate::allWidgets) // might have been deleted by ~QApplication QWidgetPrivate::allWidgets->remove(this); - QEvent e(QEvent::Destroy); - QCoreApplication::sendEvent(this, &e); + QT_TRY { + QEvent e(QEvent::Destroy); + QCoreApplication::sendEvent(this, &e); + } QT_CATCH(const std::exception&) { + // if this fails we can't do anything about it but at least we are not allowed to throw. + } } int QWidgetPrivate::instanceCounter = 0; // Current number of widget instances