Index: code/branches/core3/src/core/Identifier.cc
===================================================================
--- code/branches/core3/src/core/Identifier.cc	(revision 1681)
+++ code/branches/core3/src/core/Identifier.cc	(revision 1682)
@@ -37,4 +37,5 @@
 
 #include "Factory.h"
+#include "ConfigValueContainer.h"
 #include "ConsoleCommand.h"
 #include "CommandExecutor.h"
@@ -77,4 +78,17 @@
         delete this->children_;
         delete this->directChildren_;
+        delete this->objects_;
+
+        if (this->factory_)
+            delete this->factory_;
+
+        for (std::map<std::string, ConsoleCommand*>::iterator it = this->consoleCommands_.begin(); it != this->consoleCommands_.end(); ++it)
+            delete (it->second);
+        for (std::map<std::string, ConfigValueContainer*>::iterator it = this->configValues_.begin(); it != this->configValues_.end(); ++it)
+            delete (it->second);
+        for (std::map<std::string, XMLPortParamContainer*>::iterator it = this->xmlportParamContainers_.begin(); it != this->xmlportParamContainers_.end(); ++it)
+            delete (it->second);
+        for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it)
+            delete (it->second);
     }
 
@@ -153,4 +167,13 @@
 
     /**
+        @brief Destroys all Identifiers. Called when exiting the program.
+    */
+    void Identifier::destroyAllIdentifiers()
+    {
+        for (std::map<std::string, Identifier*>::iterator it = Identifier::getIdentifierMapIntern().begin(); it != Identifier::getIdentifierMapIntern().end(); ++it)
+            delete (it->second);
+    }
+
+    /**
         @brief Sets the name of the class.
         @param name The name
@@ -282,4 +305,5 @@
         {
             COUT(2) << "Warning: Overwriting config-value with name " << varname << " in class " << this->getName() << "." << std::endl;
+            delete (it->second);
         }
 
@@ -329,4 +353,5 @@
         {
             COUT(2) << "Warning: Overwriting console-command with name " << command->getName() << " in class " << this->getName() << "." << std::endl;
+            delete (it->second);
         }
 
@@ -367,4 +392,52 @@
         else
             return 0;
+    }
+
+    /**
+        @brief Returns a XMLPortParamContainer that loads a parameter of this class.
+        @param paramname The name of the parameter
+        @return The container
+    */
+    XMLPortParamContainer* Identifier::getXMLPortParamContainer(const std::string& paramname)
+    {
+        std::map<std::string, XMLPortParamContainer*>::const_iterator it = xmlportParamContainers_.find(paramname);
+        if (it != xmlportParamContainers_.end())
+            return ((*it).second);
+        else
+            return 0;
+    }
+
+    /**
+        @brief Adds a new XMLPortParamContainer that loads a parameter of this class.
+        @param paramname The name of the parameter
+        @param container The container
+    */
+    void Identifier::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container)
+    {
+        this->xmlportParamContainers_[paramname] = container;
+    }
+
+    /**
+        @brief Returns a XMLPortObjectContainer that attaches an object to this class.
+        @param sectionname The name of the section that contains the attachable objects
+        @return The container
+    */
+    XMLPortObjectContainer* Identifier::getXMLPortObjectContainer(const std::string& sectionname)
+    {
+        std::map<std::string, XMLPortObjectContainer*>::const_iterator it = xmlportObjectContainers_.find(sectionname);
+        if (it != xmlportObjectContainers_.end())
+            return ((*it).second);
+        else
+            return 0;
+    }
+
+    /**
+        @brief Adds a new XMLPortObjectContainer that attaches an object to this class.
+        @param sectionname The name of the section that contains the attachable objects
+        @param container The container
+    */
+    void Identifier::addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container)
+    {
+        this->xmlportObjectContainers_[sectionname] = container;
     }
 
Index: code/branches/core3/src/core/Identifier.h
===================================================================
--- code/branches/core3/src/core/Identifier.h	(revision 1681)
+++ code/branches/core3/src/core/Identifier.h	(revision 1682)
@@ -208,9 +208,9 @@
             ConfigValueContainer* getLowercaseConfigValueContainer(const std::string& varname);
 
-            virtual void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container) = 0;
-            virtual XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname) = 0;
-
-            virtual void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container) = 0;
-            virtual XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname) = 0;
+            void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container);
+            XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname);
+
+            void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container);
+            XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname);
 
             ConsoleCommand& addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut);
@@ -259,4 +259,6 @@
                 COUT(4) << "*** Identifier: Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << std::endl;
             }
+
+            static void destroyAllIdentifiers();
 
             std::set<const Identifier*> parents_;                          //!< The parents of the class the Identifier belongs to
@@ -279,4 +281,7 @@
             std::map<std::string, ConsoleCommand*> consoleCommands_;       //!< All console commands of this class
             std::map<std::string, ConsoleCommand*> consoleCommands_LC_;    //!< All console commands of this class with their names in lowercase
+
+            std::map<std::string, XMLPortParamContainer*> xmlportParamContainers_;     //!< All loadable parameters
+            std::map<std::string, XMLPortObjectContainer*> xmlportObjectContainers_;   //!< All attachable objects
     };
 
@@ -310,5 +315,5 @@
 
             void updateConfigValues(bool updateChildren = true) const;
-
+/*
             XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname);
             void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container);
@@ -316,6 +321,7 @@
             XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname);
             void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container);
-
+*/
         private:
+            ClassIdentifier(const ClassIdentifier<T>& identifier) {}    // don't copy
             ClassIdentifier()
             {
@@ -323,10 +329,19 @@
                 #include "Super.h"
             }
-            ClassIdentifier(const ClassIdentifier<T>& identifier) {}    // don't copy
-            ~ClassIdentifier() {}                                       // don't delete
-
+            ~ClassIdentifier()
+            {
+                #define SUPER_INTRUSIVE_DESTRUCTOR
+                #include "Super.h"
+/*
+                for (std::map<std::string, XMLPortParamContainer*>::iterator it = this->xmlportParamContainers_.begin(); it != this->xmlportParamContainers_.end(); ++it)
+                    delete (it->second);
+                for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it)
+                    delete (it->second);
+*/
+            }
+/*
             std::map<std::string, XMLPortClassParamContainer<class O>*> xmlportParamContainers_;              //!< All loadable parameters
             std::map<std::string, XMLPortClassObjectContainer<T, class O>*> xmlportObjectContainers_;   //!< All attachable objects
-
+*/
             static ClassIdentifier<T> *classIdentifier_s;
     };
@@ -453,5 +468,5 @@
         @param paramname The name of the parameter
         @return The container
-    */
+    *//*
     template <class T>
     XMLPortParamContainer* ClassIdentifier<T>::getXMLPortParamContainer(const std::string& paramname)
@@ -462,5 +477,5 @@
         else
             return 0;
-    }
+    }*/
 
     /**
@@ -468,10 +483,10 @@
         @param paramname The name of the parameter
         @param container The container
-    */
+    *//*
     template <class T>
     void ClassIdentifier<T>::addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container)
     {
         this->xmlportParamContainers_[paramname] = (XMLPortClassParamContainer<class O>*)container;
-    }
+    }*/
 
     /**
@@ -479,5 +494,5 @@
         @param sectionname The name of the section that contains the attachable objects
         @return The container
-    */
+    *//*
     template <class T>
     XMLPortObjectContainer* ClassIdentifier<T>::getXMLPortObjectContainer(const std::string& sectionname)
@@ -488,5 +503,5 @@
         else
             return 0;
-    }
+    }*/
 
     /**
@@ -494,10 +509,10 @@
         @param sectionname The name of the section that contains the attachable objects
         @param container The container
-    */
+    *//*
     template <class T>
     void ClassIdentifier<T>::addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container)
     {
         this->xmlportObjectContainers_[sectionname] = (XMLPortClassObjectContainer<T, class O>*)container;
-    }
+    }*/
 
 
Index: code/branches/core3/src/core/Language.cc
===================================================================
--- code/branches/core3/src/core/Language.cc	(revision 1681)
+++ code/branches/core3/src/core/Language.cc	(revision 1682)
@@ -97,4 +97,13 @@
         // Read the default language file to create all known LanguageEntry objects
         this->readDefaultLanguageFile();
+    }
+
+    /**
+        @brief Destructor: Deletes all language entries.
+    */
+    Language::~Language()
+    {
+        for (std::map<std::string, LanguageEntry*>::iterator it = this->languageEntries_.begin(); it != this->languageEntries_.end(); ++it)
+            delete (it->second);
     }
 
Index: code/branches/core3/src/core/Language.h
===================================================================
--- code/branches/core3/src/core/Language.h	(revision 1681)
+++ code/branches/core3/src/core/Language.h	(revision 1682)
@@ -123,5 +123,5 @@
             Language();
             Language(const Language& language);     // don't copy
-            virtual ~Language() {};                 // don't delete
+            virtual ~Language();
 
             void readDefaultLanguageFile();
Index: code/branches/core3/src/core/Super.h
===================================================================
--- code/branches/core3/src/core/Super.h	(revision 1681)
+++ code/branches/core3/src/core/Super.h	(revision 1682)
@@ -127,3 +127,15 @@
     #undef SUPER_INTRUSIVE_CONSTRUCTOR
   #endif /* SUPER_INTRUSIVE_CONSTRUCTOR */
+
+  #ifdef SUPER_INTRUSIVE_DESTRUCTOR
+
+////////////////////////////
+// Function-specific code //
+////////////////////////////
+
+if (this->superFunctionCaller_testfunction_)
+    delete this->superFunctionCaller_testfunction_;
+
+    #undef SUPER_INTRUSIVE_DESTRUCTOR
+  #endif /* SUPER_INTRUSIVE_DESTRUCTOR */
 #endif /* _Super_H__ */
Index: code/branches/core3/src/core/TclThreadManager.cc
===================================================================
--- code/branches/core3/src/core/TclThreadManager.cc	(revision 1681)
+++ code/branches/core3/src/core/TclThreadManager.cc	(revision 1682)
@@ -72,4 +72,17 @@
     }
 
+    TclThreadManager::~TclThreadManager()
+    {
+        unsigned int threadID;
+        {
+            boost::mutex::scoped_lock bundles_lock(this->bundlesMutex_);
+            if (this->interpreterBundles_.begin() == this->interpreterBundles_.end())
+                return;
+            else
+                threadID = this->interpreterBundles_.begin()->first;
+        }
+        this->destroy(threadID);
+    }
+
     TclThreadManager& TclThreadManager::getInstance()
     {
Index: code/branches/core3/src/core/TclThreadManager.h
===================================================================
--- code/branches/core3/src/core/TclThreadManager.h	(revision 1681)
+++ code/branches/core3/src/core/TclThreadManager.h	(revision 1682)
@@ -71,4 +71,7 @@
     class _CoreExport TclThreadManager : public OrxonoxClass
     {
+        friend class IRC;
+        friend class TclBind;
+
         public:
             static TclThreadManager& getInstance();
@@ -83,4 +86,16 @@
             static void flush(unsigned int threadID);
 
+            void error(const std::string& error);
+            void debug(const std::string& error);
+
+            virtual void tick(float dt);
+
+            std::list<unsigned int> getThreadList() const;
+
+        private:
+            TclThreadManager();
+            TclThreadManager(const TclThreadManager& other);
+            ~TclThreadManager();
+
             static void tcl_execute(Tcl::object const &args);
             static std::string tcl_query(int querierID, Tcl::object const &args);
@@ -91,6 +106,4 @@
             TclInterpreterBundle* getInterpreterBundle(unsigned int threadID);
             std::string dumpList(const std::list<unsigned int>& list);
-            void error(const std::string& error);
-            void debug(const std::string& error);
 
             void pushCommandToQueue(const std::string& command);
@@ -107,13 +120,4 @@
             std::string evalQuery(unsigned int querierID, const std::string& command);
             std::string evalQuery(unsigned int querierID, unsigned int threadID, const std::string& command);
-
-            virtual void tick(float dt);
-
-            std::list<unsigned int> getThreadList() const;
-
-        private:
-            TclThreadManager();
-            TclThreadManager(const TclThreadManager& other);
-            ~TclThreadManager() {}
 
             unsigned int threadCounter_;
Index: code/branches/core3/src/orxonox/objects/Projectile.h
===================================================================
--- code/branches/core3/src/orxonox/objects/Projectile.h	(revision 1681)
+++ code/branches/core3/src/orxonox/objects/Projectile.h	(revision 1682)
@@ -97,4 +97,5 @@
             ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
 
+/*
             SuperFunctionCaller_testfunction* superFunctionCaller = 0;
             // Search for an existing caller within all direct children
@@ -105,4 +106,5 @@
             if (!superFunctionCaller)
                 superFunctionCaller = new SuperFunctionClassCaller_testfunction<T>;
+*/
             // Iterate through all children and assign the caller
             for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it)
@@ -111,5 +113,6 @@
                 {
                     std::cout << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl;
-                    ((ClassIdentifier<T>*)(*it))->superFunctionCaller_testfunction_ = superFunctionCaller;
+//                    ((ClassIdentifier<T>*)(*it))->superFunctionCaller_testfunction_ = superFunctionCaller;
+                    ((ClassIdentifier<T>*)(*it))->superFunctionCaller_testfunction_ = new SuperFunctionClassCaller_testfunction<T>;
                 }
             }
