From: stv Date: Mon, 21 Nov 2005 12:38:04 +0000 (+0000) Subject: Delete desktop in destructor. X-Git-Tag: BR_3_1_0_deb~65 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3066bd6dbaa977aca6e6359ec2dc1dcfc47987a5;p=modules%2Fgui.git Delete desktop in destructor. --- diff --git a/src/SUIT/SUIT_Application.cxx b/src/SUIT/SUIT_Application.cxx index b0b1cd9d6..816f8d41f 100755 --- a/src/SUIT/SUIT_Application.cxx +++ b/src/SUIT/SUIT_Application.cxx @@ -24,6 +24,8 @@ SUIT_Application::~SUIT_Application() { delete myStudy; myStudy = 0; + + setDesktop( 0 ); } SUIT_Desktop* SUIT_Application::desktop() @@ -60,9 +62,17 @@ void SUIT_Application::start() bool SUIT_Application::useFile( const QString& theFileName ) { createEmptyStudy(); - if ( activeStudy() ) - return activeStudy()->openDocument( theFileName ); - return false; + SUIT_Study* study = activeStudy(); + + bool status = study ? study->openDocument( theFileName ) : false; + + if ( !status ) + { + setActiveStudy( 0 ); + delete study; + } + + return status; } bool SUIT_Application::useStudy( const QString& theName )