mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
Uses unique_ptr instead of cvf::ref
This commit is contained in:
1 parent
a73999323a
commit
ec3e1b59cd
9 files changed
+34
-61
No files matched your search
@@ -95,7 +95,7 @@ QString RimFlowDiagSolution::userDescription() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults()
|
||||
{
|
||||
if ( m_flowDiagResults.isNull() )
|
||||
if ( !m_flowDiagResults )
|
||||
{
|
||||
size_t timeStepCount;
|
||||
{
|
||||
@@ -108,10 +108,10 @@ RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults()
|
||||
timeStepCount = eclCase->eclipseCaseData()->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->maxTimeStepCount();
|
||||
}
|
||||
|
||||
m_flowDiagResults = new RigFlowDiagResults( this, timeStepCount );
|
||||
m_flowDiagResults = std::make_unique<RigFlowDiagResults>( this, timeStepCount );
|
||||
}
|
||||
|
||||
return m_flowDiagResults.p();
|
||||
return m_flowDiagResults.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -119,7 +119,7 @@ RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults() const
|
||||
{
|
||||
return m_flowDiagResults.p();
|
||||
return m_flowDiagResults.get();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -69,5 +69,5 @@ private:
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
caf::PdmField<QString> m_userDescription;
|
||||
|
||||
cvf::ref<RigFlowDiagResults> m_flowDiagResults;
|
||||
std::unique_ptr<RigFlowDiagResults> m_flowDiagResults;
|
||||
};
|
||||
Reference in new issue
Block a user