summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 95c80cad20..5d70c4c5d8 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1082,6 +1082,12 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
if (event->type() == QEvent::DeferredDelete && data == QThreadData::current()) {
// remember the current running eventloop for DeferredDelete
// events posted in the receiver's thread
+
+ // check that QEvent's d pointer is unused before we store the loop level
+ // if further updates to QEvent have made the use of the d pointer necessary,
+ // then update this code to store the loop level somewhere else
+ Q_ASSERT_X(event->d == 0, "QCoreApplication::postEvent",
+ "Internal error: this code relies on QEvent::d being null");
event->d = reinterpret_cast<QEventPrivate *>(quintptr(data->loopLevel));
}