Fix CommandLine::AddArgCommand memory leak.

This commit is contained in:
Gustavo J. A. M. Carneiro
2007-10-10 11:14:16 +01:00
parent 10baa77dbc
commit 86abaf4009
2 changed files with 15 additions and 1 deletions

View File

@@ -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));

View File

@@ -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;
};