From 88d961e516798da2e3a9c88146cf9790a8a2159b Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 20 Nov 2019 09:07:59 +0100 Subject: [PATCH] Janitor : Fix memory leak --- ApplicationCode/UserInterface/RiuQwtPlotCurve.cpp | 2 +- ApplicationCode/UserInterface/RiuQwtPlotCurve.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ApplicationCode/UserInterface/RiuQwtPlotCurve.cpp b/ApplicationCode/UserInterface/RiuQwtPlotCurve.cpp index b53ca9d2db..6656d8ef36 100644 --- a/ApplicationCode/UserInterface/RiuQwtPlotCurve.cpp +++ b/ApplicationCode/UserInterface/RiuQwtPlotCurve.cpp @@ -52,7 +52,7 @@ RiuQwtPlotCurve::RiuQwtPlotCurve( const QString& title ) m_symbolSkipPixelDistance = 10.0f; - m_errorBars = new QwtPlotIntervalCurve(); + m_errorBars = std::unique_ptr( new QwtPlotIntervalCurve() ); m_errorBars->setStyle( QwtPlotIntervalCurve::CurveStyle::NoCurve ); m_errorBars->setSymbol( new QwtIntervalSymbol( QwtIntervalSymbol::Bar ) ); m_errorBars->setItemAttribute( QwtPlotItem::Legend, false ); diff --git a/ApplicationCode/UserInterface/RiuQwtPlotCurve.h b/ApplicationCode/UserInterface/RiuQwtPlotCurve.h index 908462217c..786cebf42c 100644 --- a/ApplicationCode/UserInterface/RiuQwtPlotCurve.h +++ b/ApplicationCode/UserInterface/RiuQwtPlotCurve.h @@ -150,10 +150,10 @@ private: std::vector> m_polyLineStartStopIndices; float m_symbolSkipPixelDistance; - bool m_showErrorBars; - QwtPlotIntervalCurve* m_errorBars; - QwtPlot* m_attachedToPlot; - bool m_blackAndWhiteLegendIcon; + bool m_showErrorBars; + std::unique_ptr m_errorBars; + QwtPlot* m_attachedToPlot; + bool m_blackAndWhiteLegendIcon; std::vector m_perPointLabels; };