From c6b12d24f3522d4e5f59550223e8aa3a96a870e9 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 17 Mar 2014 11:31:08 +0400 Subject: [PATCH] Fix bug of the observer: detach an observer when study is unloaded from GUI --- src/SalomeApp/SalomeApp_Study.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 06ab38203..070cfef7d 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -694,7 +694,9 @@ void SalomeApp_Study::closeDocument(bool permanently) _PTR(Study) studyPtr = studyDS(); if ( studyPtr ) { - if(permanently) { + if ( myObserver ) + myStudyDS->detach( myObserver->_this() ); + if ( permanently ) { SalomeApp_Application::studyMgr()->Close( studyPtr ); } SALOMEDSClient_Study* aStudy = 0; -- 2.39.2