Skip to content
Snippets Groups Projects
Commit 05f43cd6 authored by Marco Bubke's avatar Marco Bubke Committed by Kai Koehne
Browse files

Fix crash for double deleted items

Reviewed-by: kkoehne
parent c09b5154
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment