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_commandRouter = std::make_unique<RimCommandRouter>();
|
||||||
m_osduConnector = nullptr;
|
m_osduConnector = nullptr;
|
||||||
|
m_sumoConnector = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -184,6 +185,16 @@ RiaApplication::~RiaApplication()
|
|||||||
RiaFontCache::clear();
|
RiaFontCache::clear();
|
||||||
|
|
||||||
caf::SelectionManager::instance()->setPdmRootObject( nullptr );
|
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()
|
RiaGuiApplication::~RiaGuiApplication()
|
||||||
{
|
{
|
||||||
|
delete m_mainWindow.data();
|
||||||
m_mainWindow.clear();
|
m_mainWindow.clear();
|
||||||
|
|
||||||
|
m_mainPlotWindow.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ Rim3dView::Rim3dView()
|
|||||||
// Every timer tick, send a signal for updating animations.
|
// Every timer tick, send a signal for updating animations.
|
||||||
// Any animation is supposed to connect to this signal
|
// Any animation is supposed to connect to this signal
|
||||||
// in order to having only one central animation driver.
|
// 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 );
|
m_animationTimer->setInterval( m_animationIntervalMillisec );
|
||||||
QObject::connect( m_animationTimer.get(), &QTimer::timeout, [this]() { updateAnimations.send(); } );
|
QObject::connect( m_animationTimer.get(), &QTimer::timeout, [this]() { updateAnimations.send(); } );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
RiuWellLogPlot::RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* parent )
|
RiuWellLogPlot::RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* parent )
|
||||||
: RiuMultiPlotPage( plotDefinition, parent )
|
: RiuMultiPlotPage( plotDefinition, parent )
|
||||||
{
|
{
|
||||||
m_verticalTrackScrollBar = new QScrollBar( nullptr );
|
m_verticalTrackScrollBar = new QScrollBar( this );
|
||||||
m_verticalTrackScrollBar->setOrientation( Qt::Vertical );
|
m_verticalTrackScrollBar->setOrientation( Qt::Vertical );
|
||||||
m_verticalTrackScrollBar->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
|
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 ) ) );
|
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->setOrientation( Qt::Horizontal );
|
||||||
m_horizontalTrackScrollBar->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
|
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 ) ) );
|
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
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* parent );
|
RiuWellLogPlot( RimDepthTrackPlot* plotDefinition, QWidget* parent );
|
||||||
|
~RiuWellLogPlot() override;
|
||||||
|
|
||||||
RimViewWindow* ownerViewWindow() const override;
|
RimViewWindow* ownerViewWindow() const override;
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,11 @@ class PdmUiTreeEditorHandle : public PdmUiEditorHandle
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PdmUiTreeEditorHandle() {}
|
PdmUiTreeEditorHandle() {}
|
||||||
~PdmUiTreeEditorHandle() override {}
|
~PdmUiTreeEditorHandle() override
|
||||||
|
{
|
||||||
|
delete m_widget.data();
|
||||||
|
m_widget.clear();
|
||||||
|
}
|
||||||
|
|
||||||
QWidget* getOrCreateWidget( QWidget* parent );
|
QWidget* getOrCreateWidget( QWidget* parent );
|
||||||
QWidget* widget() { return m_widget; }
|
QWidget* widget() { return m_widget; }
|
||||||
|
|||||||
@@ -87,8 +87,10 @@ public:
|
|||||||
explicit PdmUiTreeViewWidget( QWidget* parent = nullptr )
|
explicit PdmUiTreeViewWidget( QWidget* parent = nullptr )
|
||||||
: QTreeView( parent )
|
: QTreeView( parent )
|
||||||
{
|
{
|
||||||
setStyle( new PdmUiTreeViewStyle );
|
m_style = std::make_shared<PdmUiTreeViewStyle>();
|
||||||
|
setStyle( m_style.get() );
|
||||||
};
|
};
|
||||||
|
|
||||||
~PdmUiTreeViewWidget() override{};
|
~PdmUiTreeViewWidget() override{};
|
||||||
|
|
||||||
bool isTreeItemEditWidgetActive() const { return state() == QAbstractItemView::EditingState; }
|
bool isTreeItemEditWidgetActive() const { return state() == QAbstractItemView::EditingState; }
|
||||||
@@ -96,6 +98,8 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void dragMoveEvent( QDragMoveEvent* event ) override;
|
void dragMoveEvent( QDragMoveEvent* event ) override;
|
||||||
void dragLeaveEvent( QDragLeaveEvent* event ) override;
|
void dragLeaveEvent( QDragLeaveEvent* event ) override;
|
||||||
|
|
||||||
|
std::shared_ptr<PdmUiTreeViewStyle> m_style;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user