@@ -76,18 +76,18 @@ ipc::buff_t make_cache(T &data, std::size_t size) {
7676}
7777
7878acc_t *cc_acc (std::string const &pref) {
79- static ipc::unordered_map<std::string, ipc::shm::handle> handles;
79+ static auto *phs = new ipc::unordered_map<std::string, ipc::shm::handle>; // no delete
8080 static std::mutex lock;
8181 std::lock_guard<std::mutex> guard {lock};
82- auto it = handles. find (pref);
83- if (it == handles. end ()) {
82+ auto it = phs-> find (pref);
83+ if (it == phs-> end ()) {
8484 std::string shm_name {ipc::make_prefix (pref, " CA_CONN__" )};
8585 ipc::shm::handle h;
8686 if (!h.acquire (shm_name.c_str (), sizeof (acc_t ))) {
8787 ipc::error (" [cc_acc] acquire failed: %s\n " , shm_name.c_str ());
8888 return nullptr ;
8989 }
90- it = handles. emplace (pref, std::move (h)).first ;
90+ it = phs-> emplace (pref, std::move (h)).first ;
9191 }
9292 return static_cast <acc_t *>(it->second .get ());
9393}
@@ -248,8 +248,8 @@ auto& chunk_storages() {
248248 };
249249 using deleter_t = void (*)(chunk_handle_t *);
250250 using chunk_handle_ptr_t = std::unique_ptr<chunk_handle_t , deleter_t >;
251- static ipc::map<std::size_t , chunk_handle_ptr_t > chunk_hs;
252- return chunk_hs;
251+ static auto *chunk_hs = new ipc::map<std::size_t , chunk_handle_ptr_t >; // no delete
252+ return * chunk_hs;
253253}
254254
255255chunk_info_t *chunk_storage_info (conn_info_head *inf, std::size_t chunk_size) {
0 commit comments