summaryrefslogtreecommitdiffstats
path: root/tests/auto/qobject/tst_qobject.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-08-14 16:29:13 +1000
committerWarwick Allison <warwick.allison@nokia.com>2009-08-14 16:29:13 +1000
commit0c831b8cf84c72ee8673d1d38f4e93e350dddd5f (patch)
tree84fc3c89d73342ec70d77b2bdf99066f987536b8 /tests/auto/qobject/tst_qobject.cpp
parentb98b7d305ffebb700e471bd64a7dee59d947e056 (diff)
parent4b1b93f3f97de70af316052bc38048f52631b9e4 (diff)
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tests/auto/qobject/tst_qobject.cpp')
-rw-r--r--tests/auto/qobject/tst_qobject.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp
index 3df83d79f..bb00a0b37 100644
--- a/tests/auto/qobject/tst_qobject.cpp
+++ b/tests/auto/qobject/tst_qobject.cpp
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -119,6 +119,7 @@ private slots:
void qobjectConstCast();
void uniqConnection();
void interfaceIid();
+ void deleteQObjectWhenDeletingEvent();
protected:
};
@@ -2898,5 +2899,22 @@ void tst_QObject::interfaceIid()
QByteArray());
}
+void tst_QObject::deleteQObjectWhenDeletingEvent()
+{
+ //this is related to task 259514
+ //before the fix this used to dead lock when the QObject from the event was destroyed
+
+ struct MyEvent : public QEvent
+ {
+ MyEvent() : QEvent(QEvent::User) { }
+ QObject obj;
+ };
+
+ QObject o;
+ QApplication::postEvent(&o, new MyEvent);
+ QCoreApplication::removePostedEvents(&o); // here you would get a deadlock
+}
+
+
QTEST_MAIN(tst_QObject)
#include "tst_qobject.moc"