Commit 05f43cd6 authored by Marco Bubke's avatar Marco Bubke Committed by Kai Koehne

Fix crash for double deleted items

Reviewed-by: kkoehne
parent c09b5154
......@@ -368,7 +368,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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment