Index: trunk/src/lib/shell/shell_command.cc
===================================================================
--- trunk/src/lib/shell/shell_command.cc	(revision 5640)
+++ trunk/src/lib/shell/shell_command.cc	(revision 5641)
@@ -36,5 +36,5 @@
  * @param paramCount the count of parameters this command takes
  */
-ShellCommand::ShellCommand(const char* commandName, const char* className, Executor* executor)
+ShellCommand::ShellCommand(const char* commandName, const char* className, const Executor& executor)
 {
   this->setClassID(CL_SHELL_COMMAND, "ShellCommand");
@@ -54,5 +54,5 @@
   this->defaultValue = new MultiType[paramCount];
 
-  this->executor = executor;
+  this->executor = executor.clone();
 }
 
@@ -69,4 +69,5 @@
     delete this->alias;
   }
+  delete this->executor;
 }
 
@@ -74,5 +75,5 @@
  * registers a new ShellCommand
  */
-ShellCommand* ShellCommand::registerCommand(const char* commandName, const char* className, Executor* executor)
+ShellCommand* ShellCommand::registerCommand(const char* commandName, const char* className, const Executor& executor)
 {
   if (ShellCommand::isRegistered(commandName, className, executor))
@@ -132,5 +133,5 @@
  * This is checked in the registerCommand-function.
  */
-bool ShellCommand::isRegistered(const char* commandName, const char* className, Executor* executor)
+bool ShellCommand::isRegistered(const char* commandName, const char* className, const Executor& executor)
 {
   if (ShellCommandClass::commandClassList == NULL)
Index: trunk/src/lib/shell/shell_command.h
===================================================================
--- trunk/src/lib/shell/shell_command.h	(revision 5640)
+++ trunk/src/lib/shell/shell_command.h	(revision 5641)
@@ -41,5 +41,5 @@
 //        ShellCommand* shell_command_##class##_##command = ShellCommand<class>::registerCommand(#command, #class, &class::function)
 #define SHELL_COMMAND(command, class, function) \
-           ShellCommand* shell_command_##class##_##command = ShellCommand::registerCommand(#command, #class, new ExecutorObjective<class>(&class::function))
+           ShellCommand* shell_command_##class##_##command = ShellCommand::registerCommand(#command, #class, ExecutorObjective<class>(&class::function))
 
 /**
@@ -57,5 +57,5 @@
  */
 #define SHELL_COMMAND_STATIC(command, class, function) \
-           ShellCommand* shell_command_##class##_##command = ShellCommand::registerCommand(#command, #class, new ExecutorStatic<class>(function))
+           ShellCommand* shell_command_##class##_##command = ShellCommand::registerCommand(#command, #class, ExecutorStatic<class>(function))
 
 
@@ -72,5 +72,5 @@
     ShellCommand* defaultValues(unsigned int count, ...);
 
-    static ShellCommand* registerCommand(const char* commandName, const char* className, Executor* executor);
+    static ShellCommand* registerCommand(const char* commandName, const char* className, const Executor& executor);
 
     static void unregisterCommand(const char* commandName, const char* className);
@@ -79,12 +79,11 @@
 
   protected:
-    ShellCommand(const char* commandName, const char* className, Executor* executor);
+    ShellCommand(const char* commandName, const char* className, const Executor& executor);
     ~ShellCommand();
 
-    static bool isRegistered(const char* commandName, const char* className, Executor* executor);
+    static bool isRegistered(const char* commandName, const char* className, const Executor& executor);
     static const char* paramToString(long parameter);
 
   protected:
-    void*                            functionPointer;                      //!< The pointeer to the function of the Class (or static pointer if ClassID == CL_NULL )
     unsigned int                     paramCount;                           //!< the count of parameters.
     unsigned int*                    parameters;                           //!< Parameters the function of this Command takes.
Index: trunk/src/lib/shell/shell_command_class.cc
===================================================================
--- trunk/src/lib/shell/shell_command_class.cc	(revision 5640)
+++ trunk/src/lib/shell/shell_command_class.cc	(revision 5641)
@@ -217,5 +217,5 @@
   {
     ShellCommandClass::commandClassList = new tList<ShellCommandClass>;
-    ShellCommand::registerCommand("debug", "ShellCommand", new ExecutorStatic<ShellCommand>(ShellCommand::debug));
+    ShellCommand::registerCommand("debug", "ShellCommand", ExecutorStatic<ShellCommand>(ShellCommand::debug));
   }
 }
