From c07f87e35062e39e9d4b3b978362dbf94dd36fbb Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Tue, 9 Oct 2012 15:44:25 -0300 Subject: Fixed crash during model destruction in QML. --- tests/client/modeltest.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/client/modeltest.cpp') diff --git a/tests/client/modeltest.cpp b/tests/client/modeltest.cpp index 542b38a..8f20bc3 100644 --- a/tests/client/modeltest.cpp +++ b/tests/client/modeltest.cpp @@ -209,6 +209,28 @@ private Q_SLOTS: QCOMPARE(v.toString(), QString("42")); } + /* + * Test if model is destroyed without crash + */ + void testDestroyModel() + { + // Make menu available + m_script.publishMenu(); + m_script.run(); + + // create a new model + QDBusMenuModel *model = new QDBusMenuModel(); + model->setBusType(DBusEnums::SessionBus); + model->setBusName(MENU_SERVICE_NAME); + model->setObjectPath(MENU_OBJECT_PATH); + model->start(); + + // Wait for dbus sync + QTest::qWait(500); + + delete model; + } + }; QTEST_MAIN(ModelTest) -- cgit v1.2.3