]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
WIP
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 18 Aug 2021 14:50:13 +0000 (16:50 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 18 Aug 2021 14:50:13 +0000 (16:50 +0200)
src/NamingService/SALOME_Fake_NamingService.cxx

index ce5360833db8b0bc633454b205571604f479fe3b..a667cc03e5a9fdffe4ec7cb154da273bdb6eb27d 100644 (file)
@@ -60,6 +60,11 @@ void SALOME_Fake_NamingService::Register(CORBA::Object_ptr ObjRef, const char* P
 
 void SALOME_Fake_NamingService::Destroy_Name(const char* Path)
 {
+  std::lock_guard<std::mutex> g(_mutex);
+  std::string pathCpp(Path);
+  auto it = _map.find(pathCpp);
+  if(it!=_map.end())
+    _map.erase(it);
 }
 
 void SALOME_Fake_NamingService::Destroy_Directory(const char* Path)
@@ -72,6 +77,7 @@ void SALOME_Fake_NamingService::Destroy_FullDirectory(const char* Path)
 
 bool SALOME_Fake_NamingService::Change_Directory(const char* Path)
 {
+  std::lock_guard<std::mutex> g(_mutex);
   _current_dir = Path;
   return true;
 }
@@ -105,6 +111,7 @@ std::vector<std::string> SALOME_Fake_NamingService::list_subdirs()
 
 std::vector<std::string> SALOME_Fake_NamingService::list_directory()
 {
+  std::lock_guard<std::mutex> g(_mutex);
   std::vector<std::string> ret;
   std::vector<std::string> splitCWD(SplitDir(_current_dir));
   auto len = _current_dir.length();