From 4538ebcbb6cb98b74e46f9cdd76e81394d3ca004 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 26 Sep 2012 06:16:01 +0000 Subject: [PATCH] Fix SIGSEGV on "Display Only" operation in Plot2d viewer --- src/Plot2d/Plot2d_ViewFrame.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index 1aeff2adc..f88d4444d 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -318,8 +318,10 @@ void Plot2d_ViewFrame::EraseAll() Plot2d_QwtPlotPicker *picker = myPlot->getPicker(); // Clear points markers list and associations (marker,tooltip) - picker->pMarkers.clear(); // QList - picker->pMarkersToolTip.clear(); // QMap + if ( picker ) { + picker->pMarkers.clear(); // QList + picker->pMarkersToolTip.clear(); // QMap + } // 3)- Erase all QwtPlotCurve associated with the Plot2d_Curve @@ -3021,8 +3023,10 @@ QwtPlotMarker* Plot2d_Plot2d::createMarkerAndTooltip( QwtSymbol symbol, QColor tooltipColor( 253, 245, 230); // OldLace text.setBackgroundBrush( QBrush(tooltipColor)); //, Qt::SolidPattern)); // - picker->pMarkers.append( aPlotMarker); - picker->pMarkersToolTip[ aPlotMarker] = text; + if ( picker ) { + picker->pMarkers.append( aPlotMarker); + picker->pMarkersToolTip[ aPlotMarker] = text; + } return aPlotMarker; } -- 2.39.2