mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-10 00:52:11 +01:00
Fix adding items to the argument map.
This commit is contained in:
parent
131d4b49cc
commit
17a2780b28
@ -49,7 +49,7 @@ void ArgParser::post_process_args() {
|
||||
if (main_arg) {
|
||||
main_arg = false;
|
||||
arguments_set.insert(arg_main_command);
|
||||
arguments_map[arg_main_command] = &arg_command;
|
||||
arguments_map[arg_main_command] = new String(arg_command);
|
||||
} else {
|
||||
arguments_set.insert(arg_command);
|
||||
}
|
||||
@ -75,4 +75,13 @@ String *ArgParser::get_value(const String &arg) {
|
||||
ArgParser::ArgParser() {
|
||||
}
|
||||
ArgParser::~ArgParser() {
|
||||
for (std::map<String, String *>::iterator it = arguments_map.begin(); it != arguments_map.end(); it++) {
|
||||
String *s = it->second;
|
||||
|
||||
if (s) {
|
||||
delete s;
|
||||
}
|
||||
}
|
||||
|
||||
arguments_map.clear();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user