forked from qt-creator/qt-creator
Fix crash for double deleted items
Reviewed-by: kkoehne
(cherry picked from commit 05f43cd6ba
)
This commit is contained in:
@@ -367,7 +367,14 @@ void FormEditorScene::setPaintMode(PaintMode paintMode)
|
||||
|
||||
void FormEditorScene::clearFormEditorItems()
|
||||
{
|
||||
foreach (QGraphicsItem *item, items()) {
|
||||
QList<QGraphicsItem*> itemList(items());
|
||||
|
||||
foreach (QGraphicsItem *item, itemList) {
|
||||
if (qgraphicsitem_cast<FormEditorItem* >(item))
|
||||
item->setParentItem(0);
|
||||
}
|
||||
|
||||
foreach (QGraphicsItem *item, itemList) {
|
||||
if (qgraphicsitem_cast<FormEditorItem* >(item))
|
||||
delete item;
|
||||
}
|
||||
|
Reference in New Issue
Block a user