Fix CommandLine::AddArgCommand memory leak.
This commit is contained in:
@@ -25,6 +25,15 @@
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
CommandLine::List::~List ()
|
||||
{
|
||||
for (iterator iter = begin (); iter != end (); iter++)
|
||||
{
|
||||
delete *iter;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CommandDefaultValue CommandLine::g_help ("help",
|
||||
"Print Help text for all commands",
|
||||
MakeCallback (&CommandLine::PrintHelp));
|
||||
|
||||
@@ -85,7 +85,12 @@ public:
|
||||
T *m_valuePtr;
|
||||
};
|
||||
static void PrintHelp (void);
|
||||
typedef std::list<DefaultValueBase *> List;
|
||||
|
||||
class List : public std::list<DefaultValueBase *>
|
||||
{
|
||||
public:
|
||||
~List ();
|
||||
};
|
||||
static List *GetUserList (void);
|
||||
static CommandDefaultValue g_help;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user