Index: orxonox/trunk/src/util/object_manager.cc
===================================================================
--- orxonox/trunk/src/util/object_manager.cc	(revision 4935)
+++ orxonox/trunk/src/util/object_manager.cc	(revision 4936)
@@ -97,4 +97,87 @@
 }
 
+/**
+ *
+ */
+void FastFactory::flushAll(bool hardFLUSH)
+{
+  FastFactory* tmpFac = FastFactory::first;
+  while (tmpFac != NULL)
+  {
+    tmpFac->flush(hardFLUSH);
+    tmpFac = tmpFac->next;
+  }
+}
+
+
+/**
+ * ereases all the remaining containers, without deleting the stored Objects inside of them.
+ */
+void FastFactory::flush(bool hardFLUSH)
+{
+  FastObjectMember* tmpMember = this->deadList, *delMember = NULL;
+  while (tmpMember != NULL)
+  {
+    delMember = tmpMember;
+    tmpMember = tmpMember->next;
+    if (unlikely(hardFLUSH == true))
+      delete delMember->objectPointer;
+    delete delMember;
+  }
+  this->deadList = NULL;
+
+  tmpMember = this->unusedContainers;
+  while (tmpMember != NULL)
+  {
+    delMember = tmpMember;
+    tmpMember = tmpMember->next;
+    delete delMember;
+  }
+  this->unusedContainers = NULL;
+}
+
+
+
+BaseObject* FastFactory::resurect(ClassID classID)
+{
+  PRINTF(4)("Resurecting Object of type %s\n", this->getName());
+  if (unlikely(this->deadList == NULL))
+  {
+    PRINTF(2)("The deadList of Class %s is empty, this may be either because it has not been filled yet, or the cache is to small.\n" \
+        "Fabricating a new %s", this->getName(), this->getName());
+    this->fabricate();
+    return this->resurect(classID);
+  }
+  else
+  {
+  FastObjectMember* tmpC = deadList;
+  this->deadList = this->deadList->next;
+
+  tmpC->next = this->unusedContainers;
+  this->unusedContainers = tmpC;
+
+  return tmpC->objectPointer;
+  }
+}
+
+
+
+void FastFactory::kill(ClassID classID, BaseObject* object)
+{
+  FastObjectMember* tmpC;
+  if (unlikely(this->unusedContainers == NULL))
+  {
+    tmpC = new FastObjectMember;
+  }
+  else
+  {
+    tmpC = this->unusedContainers;
+    this->unusedContainers = this->unusedContainers->next;
+  }
+
+  tmpC->next = this->deadList;
+  tmpC->objectPointer = object;
+}
+
 
 
Index: orxonox/trunk/src/util/object_manager.h
===================================================================
--- orxonox/trunk/src/util/object_manager.h	(revision 4935)
+++ orxonox/trunk/src/util/object_manager.h	(revision 4936)
@@ -56,6 +56,10 @@
     void kill(ClassID classID, BaseObject* object);
 
+    virtual void fabricate() = NULL;
     // retrival functions for fast Ineraction
     //FastFactory* getFastFactory(ClassID classID);
+
+    static void flushAll(bool hardFLUSH = false);
+    void flush(bool hardFLUSH = false);
 
     /** @returns the first FastFactory */
@@ -102,10 +106,8 @@
 
     T* resurect();
-    void kill(T* object);
-
   private:
     tFastFactory(ClassID classID, const char* fastFactoryName);
 
-    T* fabricate();
+    virtual void fabricate();
 
   private:
@@ -142,14 +144,12 @@
 
 template<class T>
-    T* tFastFactory<T>::fabricate()
+    void tFastFactory<T>::fabricate()
 {
   FastObjectMember* tmpFirstDead = new FastObjectMember;
-  T* fabricatedT = new T();
-  tmpFirstDead->objectPointer = fabricatedT;
+  tmpFirstDead->objectPointer = new T();
   tmpFirstDead->next = this->deadList;
   ++this->storedDeadObjects;
 
   this->deadList = tmpFirstDead;
-  return fabricatedT;
 }
 
@@ -175,5 +175,6 @@
     PRINTF(2)("The deadList of Class %s is empty, this may be either because it has not been filled yet, or the cache is to small.\n" \
         "Fabricating a new %s", this->getName(), this->getName());
-    return this->fabricate();
+    this->fabricate();
+    return resurect();
   }
   else
@@ -187,22 +188,4 @@
     return dynamic_cast<T*>(tmpC->objectPointer);
   }
-}
-
-template<class T>
-    void tFastFactory<T>::kill(T* object)
-{
-  FastObjectMember* tmpC;
-  if (unlikely(this->unusedContainers == NULL))
-  {
-    tmpC = new FastObjectMember;
-  }
-  else
-  {
-    tmpC = this->unusedContainers;
-    this->unusedContainers = this->unusedContainers->next;
-  }
-
-  tmpC->next = this->deadList;
-  tmpC->objectPointer = object;
 }
 
