diff options
author | Fabien Freling <fabien.freling@nokia.com> | 2011-04-14 19:12:59 +0200 |
---|---|---|
committer | Fabien Freling <fabien.freling@nokia.com> | 2011-05-10 11:44:54 +0200 |
commit | e37d9e969189b43cd7bf289b27394171d31bf063 (patch) | |
tree | 2f27c639f5db8e4a9f3779467f4db5a779d761e0 /tests/auto | |
parent | e27baeff28d6792178a967618ca12ee7bfc91735 (diff) |
Fix an race condition in the auto test.
Deleting the page in the wizard without removing it
first leads to a crash when the wizard tries to
access a deleted page.
Reviewed-by: jasplin
(cherry picked from commit 3bff1637cd49617d334c1be63c20e008fac93be1)
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qwizard/tst_qwizard.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/qwizard/tst_qwizard.cpp b/tests/auto/qwizard/tst_qwizard.cpp index a8137273ce..bbac8a3ce7 100644 --- a/tests/auto/qwizard/tst_qwizard.cpp +++ b/tests/auto/qwizard/tst_qwizard.cpp @@ -1770,8 +1770,11 @@ public: ~TestWizard() { - foreach (int id, pageIds) - delete page(id); + foreach (int id, pageIds) { + QWizardPage *page_to_delete = page(id); + removePage(id); + delete page_to_delete; + } } void applyOperations(const QList<Operation *> &operations) |