diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-09-09 11:31:04 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-09-09 11:33:49 (GMT) |
commit | 306e7efd395ae6ebde7ee5832271ccceb4bead88 (patch) | |
tree | c3d8db5b3445d195d01f1653e354c27b0dc9e40f /src/gui/widgets/qtoolbararealayout.cpp | |
parent | 3da521bc8030671800c9442b1c7013d11a263c33 (diff) | |
download | Qt-306e7efd395ae6ebde7ee5832271ccceb4bead88.zip Qt-306e7efd395ae6ebde7ee5832271ccceb4bead88.tar.gz Qt-306e7efd395ae6ebde7ee5832271ccceb4bead88.tar.bz2 |
Fix a possible crash when deleting the QMainWindow layout
It can happen that an item is still a gap and could then be deleted
twice. We now check that to avoid double deletion.
Note: it doesn't fix the bug but avoids the crash.
Task-number: 260873
Diffstat (limited to 'src/gui/widgets/qtoolbararealayout.cpp')
-rw-r--r-- | src/gui/widgets/qtoolbararealayout.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/widgets/qtoolbararealayout.cpp b/src/gui/widgets/qtoolbararealayout.cpp index cd5c131..de11625 100644 --- a/src/gui/widgets/qtoolbararealayout.cpp +++ b/src/gui/widgets/qtoolbararealayout.cpp @@ -776,7 +776,8 @@ void QToolBarAreaLayout::deleteAllLayoutItems() for (int k = 0; k < line.toolBarItems.count(); ++k) { QToolBarAreaLayoutItem &item = line.toolBarItems[k]; - delete item.widgetItem; + if (!item.gap) + delete item.widgetItem; item.widgetItem = 0; } } |