From 19920c0ffabc6066263a2675fb79a75820a05e41 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 18 Aug 2021 16:50:13 +0200 Subject: [PATCH] WIP --- src/NamingService/SALOME_Fake_NamingService.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/NamingService/SALOME_Fake_NamingService.cxx b/src/NamingService/SALOME_Fake_NamingService.cxx index ce5360833..a667cc03e 100644 --- a/src/NamingService/SALOME_Fake_NamingService.cxx +++ b/src/NamingService/SALOME_Fake_NamingService.cxx @@ -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 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 g(_mutex); _current_dir = Path; return true; } @@ -105,6 +111,7 @@ std::vector SALOME_Fake_NamingService::list_subdirs() std::vector SALOME_Fake_NamingService::list_directory() { + std::lock_guard g(_mutex); std::vector ret; std::vector splitCWD(SplitDir(_current_dir)); auto len = _current_dir.length(); -- 2.39.2