#5106 Fix crash when importing multiple well paths with the same name

This commit is contained in:
Gaute Lindkvist
2019-11-30 10:23:24 +01:00
parent bfa9ff637b
commit 82155ae779
6 changed files with 21 additions and 21 deletions

View File

@@ -198,7 +198,7 @@ void RimWellPathCollection::loadDataAndUpdate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimFileWellPath*> RimWellPathCollection::addWellPaths( QStringList filePaths, QStringList* errorMessages )
std::vector<RimWellPath*> RimWellPathCollection::addWellPaths( QStringList filePaths, QStringList* errorMessages )
{
CAF_ASSERT( errorMessages );
@@ -254,11 +254,12 @@ std::vector<RimFileWellPath*> RimWellPathCollection::addWellPaths( QStringList f
}
readAndAddWellPaths( wellPathArray );
CAF_ASSERT( wellPathArray.empty() );
scheduleRedrawAffectedViews();
updateAllRequiredEditors();
return wellPathArray;
return wellPaths.childObjects();
}
//--------------------------------------------------------------------------------------------------
@@ -299,7 +300,7 @@ void RimWellPathCollection::readAndAddWellPaths( std::vector<RimFileWellPath*>&
progress.incrementProgress();
}
wellPathArray.clear(); // This should not be used again. We may have deleted items
this->sortWellsByName();
}