Skip to content

Commit

Permalink
destructor added
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Marini committed May 28, 2014
1 parent 5a79a35 commit 8e3a0ec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Cli.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ class Cli{
// Constructor
Cli(HardwareSerial& serial) : _serial(serial) { _cmdList = NULL;}

// Destructor
~Cli()
{
t_cmd *current, *next;
for (current = _cmdList; current; current = next)
{
next = current->next;
delete(current);
}
}

// RegisterCmd() function
// Allow the user to register a new user command
// Return an error (-1) when :
Expand Down

0 comments on commit 8e3a0ec

Please sign in to comment.