Speed up tst_QApplication::testDeleteLaterProcessEvents2()
Quit the event loop once the object is destroyed. Change-Id: I6df1cfe867daacb6af56eb84646be91d98a2f545 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
ae653fc08b
commit
00d9f68c41
@ -1366,10 +1366,11 @@ void tst_QApplication::testDeleteLaterProcessEvents2()
|
||||
// If you call deleteLater() on an object when there is no parent
|
||||
// event loop, and then enter an event loop, the object will get
|
||||
// deleted.
|
||||
QEventLoop loop;
|
||||
object = new QObject;
|
||||
connect(object, &QObject::destroyed, &loop, &QEventLoop::quit);
|
||||
p = object;
|
||||
object->deleteLater();
|
||||
QEventLoop loop;
|
||||
QTimer::singleShot(1000, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
QVERIFY(!p);
|
||||
|
Loading…
x
Reference in New Issue
Block a user