diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-10-09 12:38:59 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-10-13 12:04:53 (GMT) |
commit | 87a065002f9bc78b58c6f699ef52dda08045ad7c (patch) | |
tree | a6848af2c43217f2f4527dfa18de7ab8b3248062 /tests/auto/qapplication/tst_qapplication.cpp | |
parent | 5271d92d814e849c83d11069c322824e16db9943 (diff) | |
download | Qt-87a065002f9bc78b58c6f699ef52dda08045ad7c.zip Qt-87a065002f9bc78b58c6f699ef52dda08045ad7c.tar.gz Qt-87a065002f9bc78b58c6f699ef52dda08045ad7c.tar.bz2 |
Carbon: QApplication auto test shows bug in event dispatcher
The reason for the bug is that we call _quit_ on the eventloop
just _after_ posting the deffered delete event (from inside
deleteLater function, ref the test where it fails,
tst_qapplication.cpp:1242). And the point is, even if the loop
level tells us that we _can_ delete the object in this case, the
'quit' tells us that we should not process _any_ events (until we
get a call to processEvents again).
So this patch makes sure that we don't call sendPostedEvents from
the eventDispatcher if it is interruped.
Rev-By: brad
Diffstat (limited to 'tests/auto/qapplication/tst_qapplication.cpp')
-rw-r--r-- | tests/auto/qapplication/tst_qapplication.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp index abcacef..97aa092 100644 --- a/tests/auto/qapplication/tst_qapplication.cpp +++ b/tests/auto/qapplication/tst_qapplication.cpp @@ -1242,6 +1242,10 @@ public slots: } void deleteLaterAndExitLoop() { + // Check that 'p' is not deleted before exec returns, since the call + // to QEventLoop::quit() should stop 'eventLoop' from processing + // any more events (that is, delete later) until we return to the + // _current_ event loop: QEventLoop eventLoop; QPointer<QObject> p(this); QMetaObject::invokeMethod(this, "deleteLater", Qt::QueuedConnection); |