From a8a44e03816dc3333e7485255c5608a40e7ca408 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Tue, 26 Jun 2012 10:00:06 +1000 Subject: [PATCH] Fix crash in tst_qquicklistview. Destroy the shared canvas before QGuiApplication is destroyed. Task-number: QTBUG-26244 Change-Id: I9aa59bae5314f51c84a61821af2fb3c7a1c77941 Reviewed-by: Bea Lam --- .../quick/qquickgridview/tst_qquickgridview.cpp | 10 ++++++++++ tests/auto/quick/qquicklistview/qquicklistview.pro | 1 - .../quick/qquicklistview/tst_qquicklistview.cpp | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletions(-) diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp index 001fd0d..83a1154 100644 --- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp +++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp @@ -78,6 +78,7 @@ public: private slots: void init(); + void cleanupTestCase(); void items(); void changed(); void inserted_basic(); @@ -320,6 +321,15 @@ void tst_QQuickGridView::init() #endif } +void tst_QQuickGridView::cleanupTestCase() +{ +#ifdef SHARE_VIEWS + testForView = QString(); + delete m_view; + m_view = 0; +#endif +} + void tst_QQuickGridView::items() { QQuickView *canvas = createView(); diff --git a/tests/auto/quick/qquicklistview/qquicklistview.pro b/tests/auto/quick/qquicklistview/qquicklistview.pro index 0b873b6..98ade83 100644 --- a/tests/auto/quick/qquicklistview/qquicklistview.pro +++ b/tests/auto/quick/qquicklistview/qquicklistview.pro @@ -13,4 +13,3 @@ include (../shared/util.pri) TESTDATA = data/* QT += core-private gui-private qml-private quick-private v8-private testlib -mac: CONFIG += insignificant_test # QTBUG-26244 (exit crash) diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index f177263..92a441a 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -74,6 +74,7 @@ public: private slots: void init(); + void cleanupTestCase(); // Test both QListModelInterface and QAbstractItemModel model types void qListModelInterface_items(); void qListModelInterface_package_items(); @@ -331,6 +332,15 @@ void tst_QQuickListView::init() #endif } +void tst_QQuickListView::cleanupTestCase() +{ +#ifdef SHARE_VIEWS + testForView = QString(); + delete m_view; + m_view = 0; +#endif +} + template void tst_QQuickListView::items(const QUrl &source, bool forceLayout) { -- 1.7.2.5