mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor: fix memory leaks.
This commit is contained in:
committed by
Magne Sjaastad
parent
1736c01dfa
commit
d8eb34c00d
@@ -174,6 +174,7 @@ RiaApplication::RiaApplication()
|
||||
|
||||
m_commandRouter = std::make_unique<RimCommandRouter>();
|
||||
m_osduConnector = nullptr;
|
||||
m_sumoConnector = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -184,6 +185,16 @@ RiaApplication::~RiaApplication()
|
||||
RiaFontCache::clear();
|
||||
|
||||
caf::SelectionManager::instance()->setPdmRootObject( nullptr );
|
||||
|
||||
m_project.reset();
|
||||
|
||||
delete m_osduConnector.data();
|
||||
m_osduConnector.clear();
|
||||
m_osduConnector = nullptr;
|
||||
|
||||
delete m_sumoConnector.data();
|
||||
m_sumoConnector.clear();
|
||||
m_sumoConnector = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -190,7 +190,10 @@ RiaGuiApplication::RiaGuiApplication( int& argc, char** argv )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaGuiApplication::~RiaGuiApplication()
|
||||
{
|
||||
delete m_mainWindow.data();
|
||||
m_mainWindow.clear();
|
||||
|
||||
m_mainPlotWindow.reset();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -180,7 +180,7 @@ Rim3dView::Rim3dView()
|
||||
// Every timer tick, send a signal for updating animations.
|
||||
// Any animation is supposed to connect to this signal
|
||||
// in order to having only one central animation driver.
|
||||
m_animationTimer = std::make_unique<QTimer>( new QTimer() );
|
||||
m_animationTimer = std::make_unique<QTimer>();
|
||||
m_animationTimer->setInterval( m_animationIntervalMillisec );
|
||||
QObject::connect( m_animationTimer.get(), &QTimer::timeout, [this]() { updateAnimations.send(); } );
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
RiuWellLogPlot::RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* parent )
|
||||
: RiuMultiPlotPage( plotDefinition, parent )
|
||||
{
|
||||
m_verticalTrackScrollBar = new QScrollBar( nullptr );
|
||||
m_verticalTrackScrollBar = new QScrollBar( this );
|
||||
m_verticalTrackScrollBar->setOrientation( Qt::Vertical );
|
||||
m_verticalTrackScrollBar->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
|
||||
|
||||
@@ -27,7 +27,7 @@ RiuWellLogPlot::RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* pare
|
||||
|
||||
connect( m_verticalTrackScrollBar, SIGNAL( valueChanged( int ) ), this, SLOT( slotSetMinDepth( int ) ) );
|
||||
|
||||
m_horizontalTrackScrollBar = new QScrollBar( nullptr );
|
||||
m_horizontalTrackScrollBar = new QScrollBar( this );
|
||||
m_horizontalTrackScrollBar->setOrientation( Qt::Horizontal );
|
||||
m_horizontalTrackScrollBar->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
|
||||
|
||||
@@ -37,6 +37,15 @@ RiuWellLogPlot::RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* pare
|
||||
connect( m_horizontalTrackScrollBar, SIGNAL( valueChanged( int ) ), this, SLOT( slotSetMinDepth( int ) ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuWellLogPlot::~RiuWellLogPlot()
|
||||
{
|
||||
delete m_horizontalTrackScrollBarLayout.data();
|
||||
delete m_verticalTrackScrollBarLayout.data();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -28,6 +28,7 @@ class RiuWellLogPlot : public RiuMultiPlotPage
|
||||
Q_OBJECT
|
||||
public:
|
||||
RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* parent );
|
||||
~RiuWellLogPlot() override;
|
||||
|
||||
RimViewWindow* ownerViewWindow() const override;
|
||||
|
||||
|
||||
@@ -54,7 +54,11 @@ class PdmUiTreeEditorHandle : public PdmUiEditorHandle
|
||||
{
|
||||
public:
|
||||
PdmUiTreeEditorHandle() {}
|
||||
~PdmUiTreeEditorHandle() override {}
|
||||
~PdmUiTreeEditorHandle() override
|
||||
{
|
||||
delete m_widget.data();
|
||||
m_widget.clear();
|
||||
}
|
||||
|
||||
QWidget* getOrCreateWidget( QWidget* parent );
|
||||
QWidget* widget() { return m_widget; }
|
||||
|
||||
@@ -87,8 +87,10 @@ public:
|
||||
explicit PdmUiTreeViewWidget( QWidget* parent = nullptr )
|
||||
: QTreeView( parent )
|
||||
{
|
||||
setStyle( new PdmUiTreeViewStyle );
|
||||
m_style = std::make_shared<PdmUiTreeViewStyle>();
|
||||
setStyle( m_style.get() );
|
||||
};
|
||||
|
||||
~PdmUiTreeViewWidget() override{};
|
||||
|
||||
bool isTreeItemEditWidgetActive() const { return state() == QAbstractItemView::EditingState; }
|
||||
@@ -96,6 +98,8 @@ public:
|
||||
protected:
|
||||
void dragMoveEvent( QDragMoveEvent* event ) override;
|
||||
void dragLeaveEvent( QDragLeaveEvent* event ) override;
|
||||
|
||||
std::shared_ptr<PdmUiTreeViewStyle> m_style;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user