mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-31 17:17:50 -05:00
Fix memory leak in RicGridStatisticsDialog by moving object creation inside validity check
This commit is contained in:
1 parent
e6746cd819
commit
f27982c119
1 file changed
+8
-8
@@ -164,18 +164,18 @@ void RicGridStatisticsDialog::setHistogramData( RimGridView* view )
|
||||
{
|
||||
Rim3dOverlayInfoConfig* overlayInfo = view->overlayInfoConfig();
|
||||
|
||||
auto hist = new QwtPlotHistogram( "Histogram" );
|
||||
auto aggr = new QwtPlotCurve( "Aggregated" );
|
||||
|
||||
hist->setBrush( QBrush( QColor( Qt::darkCyan ) ) );
|
||||
hist->setZ( -1 );
|
||||
aggr->setStyle( QwtPlotCurve::Steps );
|
||||
aggr->setCurveAttribute( QwtPlotCurve::Inverted );
|
||||
|
||||
RigHistogramData histogramData = overlayInfo->histogramData();
|
||||
|
||||
if ( histogramData.isHistogramVectorValid() )
|
||||
{
|
||||
auto hist = new QwtPlotHistogram( "Histogram" );
|
||||
auto aggr = new QwtPlotCurve( "Aggregated" );
|
||||
|
||||
hist->setBrush( QBrush( QColor( Qt::darkCyan ) ) );
|
||||
hist->setZ( -1 );
|
||||
aggr->setStyle( QwtPlotCurve::Steps );
|
||||
aggr->setCurveAttribute( QwtPlotCurve::Inverted );
|
||||
|
||||
QVector<QwtIntervalSample> histSamples;
|
||||
QVector<QPointF> aggrSamples;
|
||||
double xStep = ( histogramData.max - histogramData.min ) / histogramData.histogram.size();
|
||||
|
||||
Reference in new issue
Block a user