From 8b30544f465dd7914fd3bbeb53b100368540fca1 Mon Sep 17 00:00:00 2001 From: mpa Date: Fri, 28 Aug 2015 15:35:22 +0300 Subject: [PATCH] INT PAL 0052839: SALOME crashes at Reopen if the file was renamed --- src/STD/STD_Application.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index dee6fd199..557371ac0 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -356,8 +356,6 @@ bool STD_Application::onReopenDoc() // update views / windows / status bar / title clearViewManagers(); setActiveStudy( 0 ); - updateDesktopTitle(); - updateCommandsStatus(); // delete study delete study; @@ -366,13 +364,21 @@ bool STD_Application::onReopenDoc() // post closing actions afterCloseDoc(); + int aNbStudies = 0; + QList apps = SUIT_Session::session()->applications(); + for ( int i = 0; i < apps.count(); i++ ) + aNbStudies += apps.at( i )->getNbStudies(); + // reload study from the file res = useFile( studyName ) && activeStudy(); // if reloading is failed, close the desktop - if ( !res ) { - setDesktop( 0 ); + if ( aNbStudies && !res ) closeApplication(); + else + { + updateDesktopTitle(); + updateCommandsStatus(); } } return res; -- 2.39.2