summaryrefslogtreecommitdiffstats
path: root/tests/auto/qapplication/tst_qapplication.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-10-09 14:38:59 +0200
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-10-13 14:04:53 +0200
commit87a065002f9bc78b58c6f699ef52dda08045ad7c (patch)
treea6848af2c43217f2f4527dfa18de7ab8b3248062 /tests/auto/qapplication/tst_qapplication.cpp
parent5271d92d814e849c83d11069c322824e16db9943 (diff)
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.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp
index abcacef216..97aa0924d0 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);