From 20e474586c8c20e112615e790c940def6b2c61d6 Mon Sep 17 00:00:00 2001 From: akl Date: Wed, 24 Sep 2014 16:29:15 +0400 Subject: [PATCH] Getting current session, but not it's static reference. --- src/SALOMEDS/SALOMEDS_Study_i.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 5e853fdcd..2bc96b593 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -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(); -- 2.39.2