#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 c5f21b75fa
commit 538e42f278
6 changed files with 21 additions and 21 deletions

View File

@@ -202,7 +202,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 );
@@ -259,11 +259,12 @@ std::vector<RimFileWellPath*> RimWellPathCollection::addWellPaths( QStringList f
}
readAndAddWellPaths( wellPathArray );
CAF_ASSERT( wellPathArray.empty() );
scheduleRedrawAffectedViews();
updateAllRequiredEditors();
return wellPathArray;
return wellPaths.childObjects();
}
//--------------------------------------------------------------------------------------------------
@@ -304,7 +305,7 @@ void RimWellPathCollection::readAndAddWellPaths( std::vector<RimFileWellPath*>&
progress.incrementProgress();
}
wellPathArray.clear(); // This should not be used again. We may have deleted items
this->sortWellsByName();
}

View File

@@ -89,8 +89,8 @@ public:
caf::PdmChildArrayField<RimWellPath*> wellPaths;
void loadDataAndUpdate();
std::vector<RimFileWellPath*> addWellPaths( QStringList filePaths, QStringList* errorMessages );
void loadDataAndUpdate();
std::vector<RimWellPath*> addWellPaths( QStringList filePaths, QStringList* errorMessages );
void removeWellPath( RimWellPath* wellPath );
void deleteAllWellPaths();