From aaec0e641b78e430ffeda26afeb2ca5f7924ef65 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Tue, 8 Oct 2013 15:47:43 +0200 Subject: [PATCH] add static function to remove shared memory --- DataStructures/SharedMemoryFactory.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/DataStructures/SharedMemoryFactory.h b/DataStructures/SharedMemoryFactory.h index f3d829681..b61a48b84 100644 --- a/DataStructures/SharedMemoryFactory.h +++ b/DataStructures/SharedMemoryFactory.h @@ -137,6 +137,15 @@ public: return RegionExists(key); } + template + static void RemoveSharedMemory( + const IdentifierT id + ) { + OSRMLockFile lock_file; + boost::interprocess::xsi_key key( lock_file().string().c_str(), id ); + RemoveSharedMemory(key); + } + private: static bool RegionExists( const boost::interprocess::xsi_key &key ) { bool result = true;