diff options
-rw-r--r-- | Source/kwsys/CommandLineArguments.cxx | 11 | ||||
-rw-r--r-- | Source/kwsys/CommandLineArguments.hxx.in | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx index e0d0edc..b84c9b7 100644 --- a/Source/kwsys/CommandLineArguments.cxx +++ b/Source/kwsys/CommandLineArguments.cxx @@ -359,6 +359,17 @@ void CommandLineArguments::GetRemainingArguments(int* argc, char*** argv) } //---------------------------------------------------------------------------- +void CommandLineArguments::DeleteRemainingArguments(int argc, char*** argv) +{ + int cc; + for ( cc = 0; cc < argc; ++ cc ) + { + delete [] *argv[cc]; + } + delete [] *argv; +} + +//---------------------------------------------------------------------------- void CommandLineArguments::AddCallback(const char* argument, ArgumentTypeEnum type, CallbackType callback, void* call_data, const char* help) { diff --git a/Source/kwsys/CommandLineArguments.hxx.in b/Source/kwsys/CommandLineArguments.hxx.in index 8d286fa..eea51eb 100644 --- a/Source/kwsys/CommandLineArguments.hxx.in +++ b/Source/kwsys/CommandLineArguments.hxx.in @@ -170,6 +170,7 @@ public: * delete[] on it. */ void GetRemainingArguments(int* argc, char*** argv); + void DeleteRemainingArguments(int argc, char*** argv); /** * Return string containing help. If the argument is specified, only return |