A couple of example uses of cvf::make_ref

This commit is contained in:
Gaute Lindkvist 2020-10-22 08:55:26 +02:00
parent 558bee72af
commit 69c21df6a3
3 changed files with 4 additions and 4 deletions

View File

@ -600,7 +600,7 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
if ( cvf::Option o = progOpt->option( "replaceCase" ) )
{
if ( projectModifier.isNull() ) projectModifier = new RiaProjectModifier;
if ( projectModifier.isNull() ) projectModifier = cvf::make_ref<RiaProjectModifier>();
if ( o.valueCount() == 1 )
{

View File

@ -198,7 +198,7 @@ void RiaRegressionTestRunner::runRegressionTest()
cvf::ref<RiaProjectModifier> projectModifier;
if ( regressionTestConfig.invalidateExternalFilePaths )
{
projectModifier = new RiaProjectModifier;
projectModifier = cvf::make_ref<RiaProjectModifier>();
projectModifier->setInvalidateExternalFilePaths();
}
logInfoTextWithTimeInSeconds( timeStamp, "Initializing test :" + testCaseFolder.absolutePath() );

View File

@ -76,7 +76,7 @@ caf::PdmScriptResponse RicfSingleCaseReplace::execute()
projectPath = lastProjectPath;
}
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
cvf::ref<RiaProjectModifier> projectModifier = cvf::make_ref<RiaProjectModifier>();
QString filePath = m_newGridFile();
QFileInfo casePathInfo( filePath );
@ -145,7 +145,7 @@ caf::PdmScriptResponse RicfMultiCaseReplace::execute()
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, errMsg );
}
cvf::ref<RiaProjectModifier> projectModifier = new RiaProjectModifier;
cvf::ref<RiaProjectModifier> projectModifier = cvf::make_ref<RiaProjectModifier>();
for ( const auto& a : m_caseIdToGridFileNameMap )
{
const int caseId = a.first;