summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-05-03 15:43:10 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-03 16:11:58 +0200
commit6dac3f18941bd2d66218ec43f08e4fb9be869c63 (patch)
treef2664c9f31d5046f38a1403f46eb0fc162d5242c /src/corelib/kernel/qcoreapplication.cpp
parentb4dabb9e50ce26469b0b7d71e168463abf727334 (diff)
parent1e49914fee099c4c0d634743326b50ad02e6c8f1 (diff)
Merge "Merge remote-tracking branch 'origin/api_changes'" into refs/staging/master
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));
}