Index: code/branches/core7/src/libraries/core/BaseObject.cc
===================================================================
--- code/branches/core7/src/libraries/core/BaseObject.cc	(revision 10577)
+++ code/branches/core7/src/libraries/core/BaseObject.cc	(revision 10578)
@@ -77,8 +77,10 @@
         {
             this->setFile(this->creator_->getFile());
-            this->setNamespace(this->creator_->namespace_);
-            this->setScene(this->creator_->scene_, this->creator_->sceneID_);
-            this->setGametype(this->creator_->gametype_);
-            this->setLevel(this->creator_->level_);
+
+            // store strong-pointers on all four base objects by default (can be overwritten with weak-ptr after the constructor if necessary)
+            this->setNamespace(this->creator_->namespace_.createStrongPtr());
+            this->setScene    (this->creator_->scene_    .createStrongPtr(), this->creator_->sceneID_);
+            this->setGametype (this->creator_->gametype_ .createStrongPtr());
+            this->setLevel    (this->creator_->level_    .createStrongPtr());
         }
         else
Index: code/branches/core7/src/libraries/core/BaseObject.h
===================================================================
--- code/branches/core7/src/libraries/core/BaseObject.h	(revision 10577)
+++ code/branches/core7/src/libraries/core/BaseObject.h	(revision 10578)
@@ -63,4 +63,21 @@
     {
         template <class T> friend class XMLPortClassParamContainer;
+
+        public:
+            template <class T>
+            class StrongOrWeakPtr
+            {
+                public:
+                    inline StrongOrWeakPtr();
+                    inline StrongOrWeakPtr(const StrongPtr<T>& ptr);
+                    inline StrongOrWeakPtr(const WeakPtr<T>& ptr);
+
+                    inline T* get() const;
+                    inline StrongPtr<T> createStrongPtr() const;
+
+                private:
+                    StrongPtr<T> strongPtr_;
+                    WeakPtr<T> weakPtr_;
+            };
 
         public:
@@ -138,19 +155,19 @@
                 { return this->templates_; }
 
-            inline void setNamespace(const StrongPtr<Namespace>& ns) { this->namespace_ = ns; }
-            inline Namespace* getNamespace() const { return this->namespace_; }
+            inline void setNamespace(const StrongOrWeakPtr<Namespace>& ns) { this->namespace_ = ns; }
+            inline Namespace* getNamespace() const { return this->namespace_.get(); }
 
             inline void setCreator(BaseObject* creator) { this->creator_ = creator; }
             inline BaseObject* getCreator() const { return this->creator_; }
 
-            inline void setScene(const StrongPtr<Scene>& scene, uint32_t sceneID) { this->scene_ = scene; this->sceneID_=sceneID; }
-            inline Scene* getScene() const { return this->scene_; }
+            inline void setScene(const StrongOrWeakPtr<Scene>& scene, uint32_t sceneID) { this->scene_ = scene; this->sceneID_=sceneID; }
+            inline Scene* getScene() const { return this->scene_.get(); }
             inline virtual uint32_t getSceneID() const { return this->sceneID_; }
 
-            inline void setGametype(const StrongPtr<Gametype>& gametype) { this->gametype_ = gametype; }
-            inline Gametype* getGametype() const { return this->gametype_; }
-
-            inline void setLevel(const StrongPtr<Level>& level) { this->level_ = level; }
-            inline Level* getLevel() const { return this->level_; }
+            inline void setGametype(const StrongOrWeakPtr<Gametype>& gametype) { this->gametype_ = gametype; }
+            inline Gametype* getGametype() const { return this->gametype_.get(); }
+
+            inline void setLevel(const StrongOrWeakPtr<Level>& level) { this->level_ = level; }
+            inline Level* getLevel() const { return this->level_.get(); }
 
             void addEventSource(BaseObject* source, const std::string& state);
@@ -199,16 +216,16 @@
             void registerEventStates();
 
-            bool                   bInitialized_;              //!< True if the object was initialized (passed the object registration)
-            const XMLFile*         file_;                      //!< The XMLFile that loaded this object
-            Element*               lastLoadedXMLElement_;      //!< Non 0 if the TinyXML attributes have already been copied to our own lowercase map
+            bool                       bInitialized_;          //!< True if the object was initialized (passed the object registration)
+            const XMLFile*             file_;                  //!< The XMLFile that loaded this object
+            Element*                   lastLoadedXMLElement_;  //!< Non 0 if the TinyXML attributes have already been copied to our own lowercase map
             std::map<std::string, std::string> xmlAttributes_; //!< Lowercase XML attributes
-            std::string            loaderIndentation_;         //!< Indentation of the debug output in the Loader
-            StrongPtr<Namespace>   namespace_;
-            BaseObject*            creator_;
-            StrongPtr<Scene>       scene_;
-            uint32_t               sceneID_;
-            StrongPtr<Gametype>    gametype_;
-            StrongPtr<Level>       level_;
-            std::set<Template*>    templates_;
+            std::string                loaderIndentation_;     //!< Indentation of the debug output in the Loader
+            StrongOrWeakPtr<Namespace> namespace_;
+            BaseObject*                creator_;
+            StrongOrWeakPtr<Scene>     scene_;
+            uint32_t                   sceneID_;
+            StrongOrWeakPtr<Gametype>  gametype_;
+            StrongOrWeakPtr<Level>     level_;
+            std::set<Template*>        templates_;
 
             std::map<BaseObject*, std::string>  eventSources_;           //!< List of objects which send events to this object, mapped to the state which they affect
@@ -224,4 +241,39 @@
     SUPER_FUNCTION(4, BaseObject, XMLEventPort, false);
     SUPER_FUNCTION(8, BaseObject, changedName, false);
+
+    template <class T>
+    BaseObject::StrongOrWeakPtr<T>::StrongOrWeakPtr()
+    {
+    }
+
+    template <class T>
+    BaseObject::StrongOrWeakPtr<T>::StrongOrWeakPtr(const StrongPtr<T>& ptr) : strongPtr_(ptr)
+    {
+    }
+
+    template <class T>
+    BaseObject::StrongOrWeakPtr<T>::StrongOrWeakPtr(const WeakPtr<T>& ptr) : weakPtr_(ptr)
+    {
+    }
+
+    template <class T>
+    T* BaseObject::StrongOrWeakPtr<T>::get() const
+    {
+        if (this->strongPtr_)
+            return this->strongPtr_;
+        else if (this->weakPtr_)
+            return this->weakPtr_;
+        else
+            return NULL;
+    }
+
+    template <class T>
+    StrongPtr<T> BaseObject::StrongOrWeakPtr<T>::createStrongPtr() const
+    {
+        if (this->strongPtr_)
+            return this->strongPtr_; // creates a copy
+        else
+            return this->weakPtr_; // converts automatically to StrongPtr
+    }
 }
 
Index: code/branches/core7/src/libraries/core/Namespace.cc
===================================================================
--- code/branches/core7/src/libraries/core/Namespace.cc	(revision 10577)
+++ code/branches/core7/src/libraries/core/Namespace.cc	(revision 10578)
@@ -47,5 +47,5 @@
         RegisterObject(Namespace);
 
-        this->setNamespace(StrongPtr<Namespace>(this, false));
+        this->setNamespace(WeakPtr<Namespace>(this)); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency)
     }
 
Index: code/branches/core7/src/libraries/core/object/StrongPtr.h
===================================================================
--- code/branches/core7/src/libraries/core/object/StrongPtr.h	(revision 10577)
+++ code/branches/core7/src/libraries/core/object/StrongPtr.h	(revision 10578)
@@ -142,8 +142,8 @@
             }
 
-            /// Constructor: Initializes the strong pointer with a pointer to an object. @param pointer The pointer @param bAddRef If true, the reference counter is increased. Don't set this to false unless you know exactly what you're doing! (for example to avoid circular references if the @c this pointer of the possessing object is stored)
-            inline StrongPtr(T* pointer, bool bAddRef = true) : pointer_(pointer), base_(pointer)
-            {
-                if (this->base_ && bAddRef)
+            /// Constructor: Initializes the strong pointer with a pointer to an object. @param pointer The pointer
+            inline StrongPtr(T* pointer) : pointer_(pointer), base_(pointer)
+            {
+                if (this->base_)
                     this->base_->incrementReferenceCount();
             }
Index: code/branches/core7/src/orxonox/Level.cc
===================================================================
--- code/branches/core7/src/orxonox/Level.cc	(revision 10577)
+++ code/branches/core7/src/orxonox/Level.cc	(revision 10578)
@@ -49,5 +49,5 @@
         RegisterObject(Level);
 
-        this->setLevel(StrongPtr<Level>(this, false));
+        this->setLevel(WeakPtr<Level>(this)); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency)
 
         this->registerVariables();
@@ -123,6 +123,6 @@
         Gametype* rootgametype = orxonox_cast<Gametype*>(identifier->fabricate(this));
 
-        rootgametype->setLevel(NULL); // avoid circular references
-        this->setGametype(rootgametype);
+        rootgametype->setLevel(StrongPtr<Level>(NULL)); // avoid circular references
+        this->setGametype(StrongPtr<Gametype>(rootgametype));
         rootgametype->init(); // call init() AFTER the gametype was set
 
Index: code/branches/core7/src/orxonox/Scene.cc
===================================================================
--- code/branches/core7/src/orxonox/Scene.cc	(revision 10577)
+++ code/branches/core7/src/orxonox/Scene.cc	(revision 10578)
@@ -62,5 +62,5 @@
         RegisterObject(Scene);
 
-        this->setScene(StrongPtr<Scene>(this, false), this->getObjectID());
+        this->setScene(WeakPtr<Scene>(this), this->getObjectID()); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency)
 
         this->bShadows_ = true;
Index: code/branches/core7/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/core7/src/orxonox/gametypes/Gametype.cc	(revision 10577)
+++ code/branches/core7/src/orxonox/gametypes/Gametype.cc	(revision 10578)
@@ -61,5 +61,5 @@
         RegisterObject(Gametype);
 
-        this->setGametype(StrongPtr<Gametype>(this, false));
+        this->setGametype(WeakPtr<Gametype>(this)); // store a weak-pointer to itself (a strong-pointer would create a recursive dependency)
 
         this->gtinfo_ = new GametypeInfo(context);
Index: code/branches/core7/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/branches/core7/src/orxonox/infos/PlayerInfo.cc	(revision 10577)
+++ code/branches/core7/src/orxonox/infos/PlayerInfo.cc	(revision 10578)
@@ -98,5 +98,5 @@
     {
         Gametype* oldGametype = this->getGametype();
-        this->setGametype(gametype);
+        this->setGametype(StrongPtr<Gametype>(gametype));
         Gametype* newGametype = this->getGametype();
 
