Fix bug. Piece must increase reference count for each pin.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-02-24 19:48:54 +02:00
parent 02fde1464d
commit 892e5f298f
2 changed files with 11 additions and 0 deletions

View File

@ -1075,6 +1075,7 @@ VToolSeamAllowance::VToolSeamAllowance(VAbstractPattern *doc, VContainer *data,
InitNodes(detail, scene);
InitCSAPaths(detail);
InitInternalPaths(detail);
InitPins(detail);
this->setFlag(QGraphicsItem::ItemIsMovable, true);
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
RefreshGeometry();
@ -1203,6 +1204,15 @@ void VToolSeamAllowance::InitInternalPaths(const VPiece &detail)
}
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::InitPins(const VPiece &detail)
{
for (int i = 0; i < detail.GetPins().size(); ++i)
{
doc->IncrementReferens(detail.GetPins().at(i));
}
}
//---------------------------------------------------------------------------------------------------------------------
void VToolSeamAllowance::DeleteTool(bool ask)
{

View File

@ -155,6 +155,7 @@ private:
void InitNodes(const VPiece &detail, VMainGraphicsScene *scene);
void InitCSAPaths(const VPiece &detail);
void InitInternalPaths(const VPiece &detail);
void InitPins(const VPiece &detail);
template <typename Tool>
Tool* InitTool(VMainGraphicsScene *scene, quint32 toolId);