mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Memory Management : Fixes related to plot objects and curves
This commit is contained in:
@@ -131,7 +131,6 @@ RimPlotCurve::~RimPlotCurve()
|
||||
{
|
||||
if ( m_plotCurve )
|
||||
{
|
||||
detach();
|
||||
delete m_plotCurve;
|
||||
m_plotCurve = nullptr;
|
||||
}
|
||||
@@ -1017,12 +1016,15 @@ void RimPlotCurve::detach( bool deletePlotCurve )
|
||||
{
|
||||
if ( m_plotCurve )
|
||||
{
|
||||
m_plotCurve->detach();
|
||||
if ( deletePlotCurve )
|
||||
{
|
||||
delete m_plotCurve;
|
||||
m_plotCurve = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotCurve->detach();
|
||||
}
|
||||
}
|
||||
|
||||
replotParentPlot();
|
||||
@@ -1033,7 +1035,7 @@ void RimPlotCurve::detach( bool deletePlotCurve )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::reattach()
|
||||
{
|
||||
if ( m_parentPlot ) attach( m_parentPlot );
|
||||
if ( m_parentPlot && canCurveBeAttached() ) attach( m_parentPlot );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1044,6 +1046,15 @@ bool RimPlotCurve::isSameCurve( const RiuPlotCurve* plotCurve ) const
|
||||
return m_plotCurve == plotCurve;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::deletePlotCurve()
|
||||
{
|
||||
delete m_plotCurve;
|
||||
m_plotCurve = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user