]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
no message
authorstv <stv@opencascade.com>
Mon, 30 May 2005 09:05:26 +0000 (09:05 +0000)
committerstv <stv@opencascade.com>
Mon, 30 May 2005 09:05:26 +0000 (09:05 +0000)
src/SalomeApp/SalomeApp_Study.cxx

index bd38efc32facd226b34673be5346d6e39ae9d866..7b3be65494e161eef4b9529f70aa57df69ec4f94 100644 (file)
 
 SalomeApp_Study::SalomeApp_Study( SUIT_Application* app )
 : CAM_Study( app )
-{}  
-
+{
+}  
 
 SalomeApp_Study::~SalomeApp_Study()
 {
-  closeDocument();
 }
 
 int SalomeApp_Study::id() const
@@ -188,9 +187,13 @@ void SalomeApp_Study::closeDocument()
   emit closed( this );
 
   // close SALOMEDS document
-  SalomeApp_Application::studyMgr()->Close( studyDS() );
-  SALOMEDSClient_Study* aStudy = NULL;
-  setStudyDS( _PTR(Study)(aStudy) );
+  _PTR(Study) st = studyDS();
+  if ( st.get() )
+  {
+    SalomeApp_Application::studyMgr()->Close( st );
+    SALOMEDSClient_Study* aStudy = 0;
+    setStudyDS( _PTR(Study)(aStudy) );
+  }
 
   CAM_Study::closeDocument();
 }