diff options
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 7b26a01cbf..56674bc08e 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1074,6 +1074,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)); } |