From: rnv Date: Wed, 24 Aug 2016 12:14:33 +0000 (+0300) Subject: Fix for '53219: Plot_2d Viewer' issue. X-Git-Tag: V8_1_0rc1~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2f122921e243533a053d3e40251384deb335d0fd;p=modules%2Fgui.git Fix for '53219: Plot_2d Viewer' issue. --- diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index 8f698be78..062e35493 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -1900,8 +1900,6 @@ void Plot2d_ViewFrame::updateAnalyticalCurve(Plot2d_AnalyticalCurve* c, bool upd case Plot2d_AnalyticalCurve::ActRemoveFromView: item->hide(); item->detach(); - myAnalyticalCurves.removeAll(c); - delete c; break; } @@ -1915,8 +1913,19 @@ void Plot2d_ViewFrame::updateAnalyticalCurve(Plot2d_AnalyticalCurve* c, bool upd void Plot2d_ViewFrame::updateAnalyticalCurves() { AnalyticalCurveList::iterator it = myAnalyticalCurves.begin(); + AnalyticalCurveList toDelete; for( ; it != myAnalyticalCurves.end(); it++) { - updateAnalyticalCurve(*it); + Plot2d_AnalyticalCurve* c = (*it); + updateAnalyticalCurve(c); + if(c && c->getAction() == Plot2d_AnalyticalCurve::ActRemoveFromView) + toDelete.push_back(c); + } + it = toDelete.begin(); + for( ; it != toDelete.end(); it++) { + Plot2d_AnalyticalCurve* c = (*it); + myAnalyticalCurves.removeAll(c); + delete c; + c = NULL; } myPlot->replot(); } @@ -1926,7 +1935,7 @@ void Plot2d_ViewFrame::updateAnalyticalCurves() */ AnalyticalCurveList Plot2d_ViewFrame::getAnalyticalCurves() const { - return myAnalyticalCurves; + return myAnalyticalCurves ; } /*!