Fix Valentina crash adding internal path did not increment this object

reference.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-12-04 14:08:13 +02:00
parent a0ec8ecb64
commit d1ec8e90dd
3 changed files with 4 additions and 0 deletions

View file

@ -241,6 +241,7 @@ void VToolPiecePath::AddToFile()
if (path.GetType() == PiecePathType::InternalPath)
{
newDet.GetInternalPaths().append(m_id);
incrementReferens(); // Manually increment reference since in this case a piece tool will not do this for us
}
else if (path.GetType() == PiecePathType::CustomSeamAllowance)
{
@ -248,6 +249,7 @@ void VToolPiecePath::AddToFile()
record.path = m_id;
newDet.GetCustomSARecords().append(record);
incrementReferens(); // Manually increment reference since in this case a piece tool will not do this for us
}
qApp->getUndoStack()->push(new SavePieceOptions(oldDet, newDet, doc, m_pieceId));

View file

@ -147,6 +147,7 @@ void VToolPin::AddToFile()
VPiece newDet = oldDet;
newDet.GetPins().append(m_id);
incrementReferens(); // Manually increment reference since in this case a piece tool will not do this for us
qApp->getUndoStack()->push(new SavePieceOptions(oldDet, newDet, doc, m_pieceId));
}

View file

@ -197,6 +197,7 @@ void VToolPlaceLabel::AddToFile()
VPiece newDet = oldDet;
newDet.GetPlaceLabels().append(m_id);
incrementReferens(); // Manually increment reference since in this case a piece tool will not do this for us
qApp->getUndoStack()->push(new SavePieceOptions(oldDet, newDet, doc, m_pieceId));
}
}