implements #947, free osrm-datastore's shared memory

This commit is contained in:
Dennis Luxen
2014-05-27 18:14:43 +02:00
parent 38ebdbb563
commit 3d691a3aec
2 changed files with 52 additions and 4 deletions
+8 -3
View File
@@ -43,12 +43,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string>
// generate boost::program_options object for the routing part
inline bool GenerateDataStoreOptions(const int argc, const char *argv[], ServerPaths &paths)
inline bool GenerateDataStoreOptions(const int argc, const char *argv[], ServerPaths &paths, bool & springclean)
{
// declare a group of options that will be allowed only on command line
boost::program_options::options_description generic_options("Options");
generic_options.add_options()("version,v", "Show version")("help,h", "Show this help message")(
"config,c",
generic_options.add_options()("version,v", "Show version")("help,h", "Show this help message")
("springclean,s", "Remove all regions in shared memory")("config,c",
boost::program_options::value<boost::filesystem::path>(&paths["config"])
->default_value("server.ini"),
"Path to a configuration file");
@@ -122,6 +122,11 @@ inline bool GenerateDataStoreOptions(const int argc, const char *argv[], ServerP
return false;
}
if (option_variables.count("springclean"))
{
springclean = true;
return true;
}
boost::program_options::notify(option_variables);
const bool parameter_present = (paths.find("hsgrdata") != paths.end() &&