#7929 Python : Make sure progress dialog is created after early exit

On some systems, the progress dialog triggers redraw with incomplete data and causes crash. Make sure the progress dialog is created after early exit
This commit is contained in:
Magne Sjaastad 2021-09-03 08:19:34 +02:00
parent ea6e734a55
commit 7260d318e4

View File

@ -109,14 +109,16 @@ bool RimEclipseResultCase::openEclipseGridFile()
//--------------------------------------------------------------------------------------------------
bool RimEclipseResultCase::importGridAndResultMetaData( bool showTimeStepFilter )
{
// Early exit if data is already read
// Make sure that the progress info dialog is created after the return statement. If created before, the progress
// dialog triggers a redraw with incomplete geometry data and causes a crash
if ( m_gridAndWellDataIsReadFromFile ) return true;
caf::ProgressInfo progInfo( 50, "Reading Eclipse Grid File" );
progInfo.setProgressDescription( "Open Grid File" );
progInfo.setNextProgressIncrement( 48 );
// Early exit if data is already read
if ( m_gridAndWellDataIsReadFromFile ) return true;
cvf::ref<RifReaderInterface> readerInterface;
if ( gridFileName().contains( "Result Mock Debug Model" ) )