diff --git a/src/core/command-line.cc b/src/core/command-line.cc index 484538384..f551cebf3 100644 --- a/src/core/command-line.cc +++ b/src/core/command-line.cc @@ -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)); diff --git a/src/core/command-line.h b/src/core/command-line.h index 8a1c49daa..7edd7becb 100644 --- a/src/core/command-line.h +++ b/src/core/command-line.h @@ -85,7 +85,12 @@ public: T *m_valuePtr; }; static void PrintHelp (void); - typedef std::list List; + + class List : public std::list + { + public: + ~List (); + }; static List *GetUserList (void); static CommandDefaultValue g_help; };