diff -r dee5afe5301f -r 3f74d0d4af4c tests/auto/qobject/tst_qobject.cpp --- a/tests/auto/qobject/tst_qobject.cpp Mon Mar 15 12:43:09 2010 +0200 +++ b/tests/auto/qobject/tst_qobject.cpp Thu Apr 08 14:19:33 2010 +0300 @@ -2647,6 +2647,16 @@ QVERIFY(spy.eventList().isEmpty()); } +class EmitThread : public QThread +{ Q_OBJECT +public: + void run(void) { + emit work(); + } +signals: + void work(); +}; + class DeleteObject : public QObject { Q_OBJECT @@ -2712,6 +2722,16 @@ QVERIFY(thread.wait(10000)); } + + { + EmitThread sender; + DeleteObject *receiver = new DeleteObject(); + connect(&sender, SIGNAL(work()), receiver, SLOT(deleteSelf()), Qt::DirectConnection); + QPointer p = receiver; + sender.start(); + QVERIFY(sender.wait(10000)); + QVERIFY(p.isNull()); + } } class DisconnectObject : public QObject