From fb6e3b29ff1780644d5a54b010c298a049d3e7d2 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 2 Feb 2016 15:50:15 +0200 Subject: [PATCH] Updated the tool "Point of intersection curves" to new correct way work with references. --HG-- branch : develop --- .../vtoolpointofintersectioncurves.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index a077d58d8..080c553ce 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -121,8 +121,8 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(const qui connect(scene, &VMainGraphicsScene::DisableItem, point, &VToolPointOfIntersectionCurves::Disable); connect(scene, &VMainGraphicsScene::EnableToolMove, point, &VToolPointOfIntersectionCurves::EnableToolMove); doc->AddTool(id, point); - doc->IncrementReferens(firstCurveId); - doc->IncrementReferens(secondCurveId); + doc->IncrementReferens(curve1->getIdTool()); + doc->IncrementReferens(curve2->getIdTool()); return point; } return nullptr; @@ -324,8 +324,11 @@ void VToolPointOfIntersectionCurves::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- void VToolPointOfIntersectionCurves::RemoveReferens() { - doc->DecrementReferens(firstCurveId); - doc->DecrementReferens(secondCurveId); + const auto curve1 = VAbstractTool::data.GetGObject(firstCurveId); + const auto curve2 = VAbstractTool::data.GetGObject(secondCurveId); + + doc->DecrementReferens(curve1->getIdTool()); + doc->DecrementReferens(curve2->getIdTool()); } //---------------------------------------------------------------------------------------------------------------------