diff -r 2f34d5167611 -r fcece45ef507 tests/auto/qobject/tst_qobject.cpp --- a/tests/auto/qobject/tst_qobject.cpp Fri Apr 16 15:50:13 2010 +0300 +++ b/tests/auto/qobject/tst_qobject.cpp Mon May 03 13:17:34 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