Commit 2ffc045b authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.formEditor: fixes memory leak

Also fixes the memory leak in resize code.
cleanup

Reviewed-by: Marco Bubke
parent b6bf93a2
......@@ -198,8 +198,6 @@ QPointF MoveManipulator::findSnappingOffset(const QHash<FormEditorItem*, QRectF>
void MoveManipulator::generateSnappingLines(const QHash<FormEditorItem*, QRectF> &boundingRectHash)
{
qDeleteAll(m_graphicsLineList);
m_graphicsLineList.clear();
m_graphicsLineList = m_snapper.generateSnappingLines(boundingRectHash.values(),
m_layerItem.data(),
m_snapper.transformtionSpaceFormEditorItem()->sceneTransform());
......@@ -417,8 +415,10 @@ void MoveManipulator::setOpacityForAllElements(qreal opacity)
void MoveManipulator::deleteSnapLines()
{
if (m_layerItem) {
foreach (QGraphicsItem *item, m_graphicsLineList)
foreach (QGraphicsItem *item, m_graphicsLineList) {
m_layerItem->scene()->removeItem(item);
delete item;
}
}
m_graphicsLineList.clear();
m_view->scene()->update();
......
......@@ -474,8 +474,10 @@ bool ResizeManipulator::isInvalidSize(const QSizeF & size)
void ResizeManipulator::deleteSnapLines()
{
if (m_layerItem) {
foreach (QGraphicsItem *item, m_graphicsLineList)
foreach (QGraphicsItem *item, m_graphicsLineList) {
m_layerItem->scene()->removeItem(item);
delete item;
}
}
m_graphicsLineList.clear();
......
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