From e95de30977291a251660f72baa84b5ff244711fb Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 30 Aug 2011 12:34:31 +0400 Subject: don't crash when destroying the shortcuts as shortcutDestroyed(..) modifies the shortcuts list. disconnect from shortcutDestroyed() first, or operate on a detach()-ed list this was uncovered by QList::removaAll() optimization patch. --- tests/auto/qshortcut/tst_qshortcut.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/qshortcut/tst_qshortcut.cpp b/tests/auto/qshortcut/tst_qshortcut.cpp index a78e8cf..d761b19 100644 --- a/tests/auto/qshortcut/tst_qshortcut.cpp +++ b/tests/auto/qshortcut/tst_qshortcut.cpp @@ -1124,7 +1124,8 @@ void tst_QShortcut::context() // ------------------------------------------------------------------ void tst_QShortcut::clearAllShortcuts() { - qDeleteAll(shortcuts); + QList shortcutsCpy = shortcuts; + qDeleteAll(shortcutsCpy); shortcuts.clear(); } -- cgit v0.12