summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-07-22 12:53:02 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-07-22 12:53:02 (GMT)
commitec0ce7be116f0c4f854ef1efbb90d22f7c76aa4d (patch)
tree56b18bcdc50fcc7a02ed7ac3ccbf111f3e8a5b2d /src/gui/kernel
parent733ea3622dc6feb06979bade95318664a94a6e21 (diff)
downloadQt-ec0ce7be116f0c4f854ef1efbb90d22f7c76aa4d.zip
Qt-ec0ce7be116f0c4f854ef1efbb90d22f7c76aa4d.tar.gz
Qt-ec0ce7be116f0c4f854ef1efbb90d22f7c76aa4d.tar.bz2
Don't crash if widget is deleted before event is processed
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication_qpa.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp
index a433ccd..d289dee 100644
--- a/src/gui/kernel/qapplication_qpa.cpp
+++ b/src/gui/kernel/qapplication_qpa.cpp
@@ -828,6 +828,10 @@ void QApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Leave
void QApplicationPrivate::processMoveEvent(QWindowSystemInterfacePrivate::MoveEvent *moveEvent)
{
+ if (moveEvent->moved.isNull()) {
+ //qDebug() << "QApplicationPrivate::processMoveEvent NULL";
+ return;
+ }
moveEvent->moved.data()->data->crect.setTopLeft(moveEvent->newPos);
QMoveEvent e(moveEvent->moved.data()->geometry().topLeft(), moveEvent->newPos);
QApplication::sendSpontaneousEvent(moveEvent->moved.data(), &e);
@@ -835,6 +839,10 @@ void QApplicationPrivate::processMoveEvent(QWindowSystemInterfacePrivate::MoveEv
void QApplicationPrivate::processResizeEvent(QWindowSystemInterfacePrivate::ResizeEvent *e)
{
+ if (e->sizeChanged.isNull()) {
+ //qDebug() << "QApplicationPrivate::processResizeEvent NULL";
+ return;
+ }
e->sizeChanged.data()->data->crect.setSize(e->newSize);
QResizeEvent resizeEvent(e->sizeChanged.data()->data->crect.size(), e->newSize);
QApplication::sendSpontaneousEvent(e->sizeChanged.data(), &resizeEvent);
@@ -843,6 +851,10 @@ void QApplicationPrivate::processResizeEvent(QWindowSystemInterfacePrivate::Resi
void QApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent *e)
{
+ if (e->topLevel.isNull()) {
+ //qDebug() << "QApplicationPrivate::processCloseEvent NULL";
+ return;
+ }
e->topLevel.data()->d_func()->close_helper(QWidgetPrivate::CloseWithSpontaneousEvent);
}