Index: code/branches/core5/src/libraries/core/OrxonoxClass.cc
===================================================================
--- code/branches/core5/src/libraries/core/OrxonoxClass.cc	(revision 5785)
+++ code/branches/core5/src/libraries/core/OrxonoxClass.cc	(revision 5791)
@@ -45,4 +45,6 @@
         this->parents_ = 0;
         this->metaList_ = new MetaObjectList();
+        this->referenceCount_ = 0;
+        this->requestedDestruction_ = false;
     }
 
@@ -55,4 +57,13 @@
         if (this->parents_)
             delete this->parents_;
+    }
+
+    /** @brief Deletes the object if no smart pointers point to this object. Otherwise schedules the object to be deleted as soon as possible. */
+    void OrxonoxClass::destroy()
+    {
+        if (this->referenceCount_ > 0)
+            this->requestedDestruction_ = true;
+        else
+            delete this;
     }
 
Index: code/branches/core5/src/libraries/core/OrxonoxClass.h
===================================================================
--- code/branches/core5/src/libraries/core/OrxonoxClass.h	(revision 5785)
+++ code/branches/core5/src/libraries/core/OrxonoxClass.h	(revision 5791)
@@ -59,4 +59,6 @@
             virtual ~OrxonoxClass();
 
+            void destroy();
+
             /** @brief Function to collect the SetConfigValue-macro calls. */
             void setConfigValues() {};
@@ -92,4 +94,7 @@
             bool isDirectParentOf(const OrxonoxClass* object);
 
+            inline unsigned int getReferenceCount() const
+                { return this->referenceCount_; }
+
             /**
             @brief
@@ -117,7 +122,17 @@
 
         private:
+            /** @brief Increments the reference counter (for smart pointers). */
+            inline void incrementReferenceCount()
+                { ++this->referenceCount_; }
+            /** @brief Decrements the reference counter (for smart pointers). */
+            inline void decrementReferenceCount()
+                { --this->referenceCount_; if (this->referenceCount_ == 0 && this->requestedDestruction_) { delete this; } }
+
             Identifier* identifier_;                   //!< The Identifier of the object
             std::set<const Identifier*>* parents_;     //!< List of all parents of the object
             MetaObjectList* metaList_;                 //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in
+            unsigned int referenceCount_;              //!< Counts the references from smart pointers to this object
+            bool requestedDestruction_;                //!< Becomes true after someone called delete on this object
+
             //! 'Fast map' that holds this-pointers of all derived types
             std::vector<std::pair<unsigned int, void*> > objectPointers_;
Index: code/branches/core5/src/libraries/tools/Timer.h
===================================================================
--- code/branches/core5/src/libraries/tools/Timer.h	(revision 5785)
+++ code/branches/core5/src/libraries/tools/Timer.h	(revision 5791)
@@ -143,5 +143,6 @@
                 @param exeuctor A executor of the function to call
             */
-            Timer(float interval, bool bLoop, T* object, ExecutorMember<T>* exeuctor, bool bKillAfterCall = false)
+            template <class O>
+            Timer(float interval, bool bLoop, T* object, ExecutorMember<O>* exeuctor, bool bKillAfterCall = false)
             {
                 this->setTimer(interval, bLoop, object, exeuctor, bKillAfterCall);
@@ -155,5 +156,6 @@
                 @param exeuctor A executor of the function to call
             */
-            void setTimer(float interval, bool bLoop, T* object, ExecutorMember<T>* executor, bool bKillAfterCall = false)
+            template <class O>
+            void setTimer(float interval, bool bLoop, T* object, ExecutorMember<O>* executor, bool bKillAfterCall = false)
             {
                 this->deleteExecutor();
Index: code/branches/core5/src/modules/weapons/MuzzleFlash.cc
===================================================================
--- code/branches/core5/src/modules/weapons/MuzzleFlash.cc	(revision 5785)
+++ code/branches/core5/src/modules/weapons/MuzzleFlash.cc	(revision 5791)
@@ -41,13 +41,6 @@
         RegisterObject(MuzzleFlash);
         this->setScale(0.1f);
-        
+
         this->delayTimer_.setTimer(0.1f, false, this, createExecutor(createFunctor(&MuzzleFlash::destroy)));
-
     }
-
-    void MuzzleFlash::destroy()
-    {
-        delete this;
-    }
- 
 }
Index: code/branches/core5/src/modules/weapons/MuzzleFlash.h
===================================================================
--- code/branches/core5/src/modules/weapons/MuzzleFlash.h	(revision 5785)
+++ code/branches/core5/src/modules/weapons/MuzzleFlash.h	(revision 5791)
@@ -43,10 +43,6 @@
             virtual ~MuzzleFlash() {}
 
-
-
         private:
-            void destroy();
             Timer<MuzzleFlash> delayTimer_;
-
     };
 }
Index: code/branches/core5/src/orxonox/graphics/ParticleSpawner.h
===================================================================
--- code/branches/core5/src/orxonox/graphics/ParticleSpawner.h	(revision 5785)
+++ code/branches/core5/src/orxonox/graphics/ParticleSpawner.h	(revision 5791)
@@ -46,6 +46,6 @@
             virtual void processEvent(Event& event);
 
-            inline void destroy()
-                { this->bForceDestroy_ = true; this->stopParticleSpawner(); }
+            inline void stop(bool bDestroy)
+                { this->bForceDestroy_ = bDestroy; this->stopParticleSpawner(); }
             inline void spawn()
                 { this->bSuppressStart_ = false; this->startParticleSpawner(); }
Index: code/branches/core5/src/orxonox/overlays/InGameConsole.h
===================================================================
--- code/branches/core5/src/orxonox/overlays/InGameConsole.h	(revision 5785)
+++ code/branches/core5/src/orxonox/overlays/InGameConsole.h	(revision 5791)
@@ -50,5 +50,4 @@
 
         void initialise();
-        void destroy();
         void setConfigValues();
 
Index: code/branches/core5/src/orxonox/worldentities/BigExplosion.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/BigExplosion.cc	(revision 5785)
+++ code/branches/core5/src/orxonox/worldentities/BigExplosion.cc	(revision 5791)
@@ -333,9 +333,4 @@
     }
 
-    void BigExplosion::destroy()
-    {
-        delete this;
-    }
-
 /* TODO
 
Index: code/branches/core5/src/orxonox/worldentities/BigExplosion.h
===================================================================
--- code/branches/core5/src/orxonox/worldentities/BigExplosion.h	(revision 5785)
+++ code/branches/core5/src/orxonox/worldentities/BigExplosion.h	(revision 5791)
@@ -57,5 +57,4 @@
             void checkStop();
             void stop();
-            void destroy();
             void init();
             void initZero();
@@ -98,6 +97,6 @@
             ParticleInterface*    explosionFire_;
 
-            LODParticle::Value      LOD_;
-            Timer<BigExplosion> destroyTimer_;
+            LODParticle::Value    LOD_;
+            Timer<BigExplosion>   destroyTimer_;
     };
 }
Index: code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc
===================================================================
--- code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc	(revision 5785)
+++ code/branches/core5/src/orxonox/worldentities/ExplosionChunk.cc	(revision 5791)
@@ -136,9 +136,4 @@
     }
 
-    void ExplosionChunk::destroy()
-    {
-        delete this;
-    }
-
     void ExplosionChunk::tick(float dt)
     {
Index: code/branches/core5/src/orxonox/worldentities/ExplosionChunk.h
===================================================================
--- code/branches/core5/src/orxonox/worldentities/ExplosionChunk.h	(revision 5785)
+++ code/branches/core5/src/orxonox/worldentities/ExplosionChunk.h	(revision 5791)
@@ -55,10 +55,9 @@
             void checkStop();
             void stop();
-            void destroy();
 
             bool                  bStop_;
             ParticleInterface*    fire_;
             ParticleInterface*    smoke_;
-            LODParticle::Value      LOD_;
+            LODParticle::Value    LOD_;
             Timer<ExplosionChunk> destroyTimer_;
     };
