Index: code/branches/core6/src/libraries/core/class/Identifier.h
===================================================================
--- code/branches/core6/src/libraries/core/class/Identifier.h	(revision 9650)
+++ code/branches/core6/src/libraries/core/class/Identifier.h	(revision 9651)
@@ -409,5 +409,6 @@
     void ClassIdentifier<T>::addObjectToList(T* object, Listable* listable)
     {
-        listable->getContext()->addObject(object);
+        if (listable->getContext())
+            listable->getContext()->addObject(object);
     }
 
Index: code/branches/core6/src/libraries/core/class/IdentifierManager.cc
===================================================================
--- code/branches/core6/src/libraries/core/class/IdentifierManager.cc	(revision 9650)
+++ code/branches/core6/src/libraries/core/class/IdentifierManager.cc	(revision 9651)
@@ -127,4 +127,8 @@
                 initializedIdentifiers.insert(it->second);
             }
+
+            size_t numberOfObjects = temporaryContext.getObjectList<Listable>()->size();
+            if (numberOfObjects > 0)
+                orxout(internal_warning) << "There are still " << numberOfObjects << " listables left after creating the class hierarchy" << endl;
         }
 
Index: code/branches/core6/src/libraries/core/object/Context.cc
===================================================================
--- code/branches/core6/src/libraries/core/object/Context.cc	(revision 9650)
+++ code/branches/core6/src/libraries/core/object/Context.cc	(revision 9651)
@@ -42,13 +42,26 @@
     Context* Context::rootContext_s = 0;
 
-    Context::Context(Context* context) : Listable(this), parentContext_(context)
+    Context* getContextForInitializationOfOtherContexts()
     {
-        // we have to call Listable(this) to avoid circular initialization when creating a Context because Listable calls Context::getRootContext() by
-        // default AND we have to set the context again in the constructor because of other classes inheriting from Context (Listable is a virtual base
-        // and each subclass must call its constructor individually, so either all subclasses add Listable(this) to their initialization list or we call
-        // setContext(this) here).
+        static size_t count = 0;
+        // the first time this is called, ++count returns 1 and the context is created
+        // the second time this is called, ++count returns 2 and NULL is returned because we're in the constructor of the context itself
+        // for each future call the context (now completely created) is returned
+        if (++count == 2)
+            return NULL;
+        else
+        {
+            static Context context(NULL);
+            return &context;
+        }
+    }
+
+    // Initialize Listable(*) with a special context, only used to initialize other contexts. Later in the constructor we change the context
+    Context::Context(Context* context) : Listable(getContextForInitializationOfOtherContexts()), parentContext_(context)
+    {
+        RegisterObject(Context);
+
+        // the context is its own context
         this->setContext(this);
-
-        RegisterObject(Context);
     }
 
Index: code/branches/core6/src/libraries/core/object/Listable.cc
===================================================================
--- code/branches/core6/src/libraries/core/object/Listable.cc	(revision 9650)
+++ code/branches/core6/src/libraries/core/object/Listable.cc	(revision 9651)
@@ -33,4 +33,5 @@
 
 #include "Listable.h"
+#include "core/CoreIncludes.h"
 #include "ObjectListBase.h"
 #include "Context.h"
@@ -38,4 +39,6 @@
 namespace orxonox
 {
+    RegisterClass(Listable);
+
     /**
         @brief Constructor: Allocates space in the element list.
@@ -45,8 +48,10 @@
         this->context_ = Context::getRootContext();
         this->elements_.reserve(6);
+
+        RegisterObject(Listable);
     }
 
     /**
-        @brief Constructor: Allocates space in the element list and assignes the context
+        @brief Constructor: Allocates space in the element list and assigns the context
     */
     Listable::Listable(Context* context)
@@ -54,4 +59,6 @@
         this->context_ = context;
         this->elements_.reserve(6);
+
+        RegisterObject(Listable);
     }
 
@@ -80,4 +87,5 @@
     void Listable::setContext(Context* context)
     {
+        assert(context);
         std::vector<ObjectListBaseElement*> copy = this->elements_;
         this->elements_.clear();
Index: code/branches/core6/test/core/class/IdentifierClassHierarchyTest.cc
===================================================================
--- code/branches/core6/test/core/class/IdentifierClassHierarchyTest.cc	(revision 9650)
+++ code/branches/core6/test/core/class/IdentifierClassHierarchyTest.cc	(revision 9651)
@@ -130,4 +130,6 @@
                 virtual void SetUp()
                 {
+                    registerClass("Context", new ClassFactoryWithContext<Context>());
+                    registerClass("Listable", new ClassFactoryWithContext<Listable>());
                     registerClass("OrxonoxInterface", new ClassFactoryNoArgs<OrxonoxInterface>());
                     registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>());
@@ -230,6 +232,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxInterface)));
 
-        EXPECT_EQ(2u, identifier->getParents().size());
-        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_EQ(3u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
     }
@@ -252,6 +255,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxInterface)));
 
-        EXPECT_EQ(2u, identifier->getParents().size());
-        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_EQ(3u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
     }
@@ -274,6 +278,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface1)));
 
-        EXPECT_EQ(3u, identifier->getParents().size());
-        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_EQ(4u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1)));
@@ -295,6 +300,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface2)));
 
-        EXPECT_EQ(3u, identifier->getParents().size());
-        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_EQ(4u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface2)));
@@ -322,6 +328,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
 
-        EXPECT_EQ(2u, identifier->getParents().size());
-        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_EQ(3u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
     }
@@ -338,6 +345,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
 
-        EXPECT_EQ(3u, identifier->getParents().size());
-        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_EQ(4u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
@@ -356,6 +364,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface1)));
 
-        EXPECT_EQ(6u, identifier->getParents().size());
-        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_EQ(7u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
@@ -378,6 +387,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface2)));
 
-        EXPECT_EQ(8u, identifier->getParents().size());
-        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_EQ(9u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
@@ -402,6 +412,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface2)));
 
-        EXPECT_EQ(8u, identifier->getParents().size());
-        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_EQ(9u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
@@ -426,6 +437,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface2)));
 
-        EXPECT_EQ(6u, identifier->getParents().size());
-        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_EQ(7u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
Index: code/branches/core6/test/core/class/IdentifierSimpleClassHierarchyTest.cc
===================================================================
--- code/branches/core6/test/core/class/IdentifierSimpleClassHierarchyTest.cc	(revision 9650)
+++ code/branches/core6/test/core/class/IdentifierSimpleClassHierarchyTest.cc	(revision 9651)
@@ -46,4 +46,6 @@
                 virtual void SetUp()
                 {
+                    registerClass("Context", new ClassFactoryWithContext<Context>());
+                    registerClass("Listable", new ClassFactoryWithContext<Listable>());
                     registerClass("OrxonoxInterface", new ClassFactoryNoArgs<OrxonoxInterface>());
                     registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>());
@@ -99,6 +101,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxInterface)));
 
-        EXPECT_EQ(2u, identifier->getParents().size());
+        EXPECT_EQ(3u, identifier->getParents().size());
         EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
     }
@@ -117,6 +120,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
 
-        EXPECT_EQ(2u, identifier->getParents().size());
+        EXPECT_EQ(3u, identifier->getParents().size());
         EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
     }
@@ -134,6 +138,7 @@
         EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
 
-        EXPECT_EQ(5u, identifier->getParents().size());
+        EXPECT_EQ(6u, identifier->getParents().size());
         EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Listable)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
         EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
