mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-09-08 03:40:21 -04:00
Recommit because something is strange. The changes are that memory allocated in _construct is deallocated when the CmdLine obj is destroyed
This commit is contained in:
parent
6c06e31bb2
commit
4362a50705
@ -93,6 +93,9 @@ class CmdLine
|
||||
*/
|
||||
XorHandler _xorHandler;
|
||||
|
||||
std::list<Arg*> _argDeleteOnExitList;
|
||||
std::list<Visitor*> _visitorDeleteOnExitList;
|
||||
|
||||
/**
|
||||
* Checks whether a name/flag string matches entirely matches
|
||||
* the Arg::blankChar. Used when multiple switches are combined
|
||||
@ -122,6 +125,16 @@ class CmdLine
|
||||
*/
|
||||
void _constructor();
|
||||
|
||||
/**
|
||||
* Perform a delete ptr; operation on ptr when this object is deleted.
|
||||
*/
|
||||
void deleteOnExit(Arg* ptr);
|
||||
|
||||
/**
|
||||
* Perform a delete ptr; operation on ptr when this object is deleted.
|
||||
*/
|
||||
void deleteOnExit(Visitor* ptr);
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
@ -151,6 +164,9 @@ class CmdLine
|
||||
CmdLine(const std::string& message,
|
||||
const char delimiter = ' ',
|
||||
const std::string& version = "none" );
|
||||
|
||||
///Deletes any resources allocated by a CmdLine object
|
||||
~CmdLine();
|
||||
|
||||
/**
|
||||
* Adds an argument to the list of arguments to be parsed.
|
||||
|
Loading…
x
Reference in New Issue
Block a user