]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Getting current session, but not it's static reference.
authorakl <alexander.kovalev@opencascade.com>
Wed, 24 Sep 2014 12:29:15 +0000 (16:29 +0400)
committerakl <alexander.kovalev@opencascade.com>
Wed, 24 Sep 2014 12:29:15 +0000 (16:29 +0400)
src/SALOMEDS/SALOMEDS_Study_i.cxx

index 5e853fdcdd97d02b4c75628516bcfec89e17b713..2bc96b593a14b819e1a9931e23a991bd1c4fd8ba 100644 (file)
@@ -887,13 +887,15 @@ void SALOMEDS_Study_i::Close()
   itcomponent->UnRegister();
 
   // Notify GUI that study is closed
-  SALOME::Session_var aSession = KERNEL::getSalomeSession();
+  SALOME_NamingService *aNamingService = KERNEL::getNamingService();
+  CORBA::Object_ptr obj = aNamingService->Resolve("/Kernel/Session");
+  SALOME::Session_var aSession = SALOME::Session::_narrow(obj);
   if ( !CORBA::is_nil(aSession) ) {
     long studyId = aSession->GetActiveStudyId();
     std::stringstream ss;
     ss << "studyClosed:" << studyId;
     std::string str = ss.str();
-    aSession->emitMessage(str.c_str());
+    aSession->emitMessageOneWay(str.c_str());
   }
 
   _impl->Close();