Index: /orxonox/trunk/src/lib/coord/p_node.cc
===================================================================
--- /orxonox/trunk/src/lib/coord/p_node.cc	(revision 3530)
+++ /orxonox/trunk/src/lib/coord/p_node.cc	(revision 3531)
@@ -110,4 +110,6 @@
   this->parent = NULL;
   /* there is currently a problem with cleaning up - fix*/
+
+  this->destroy();
 }
 
@@ -128,4 +130,6 @@
   /* this deletes all children in the list */
   this->children->destroy ();
+
+  static_cast<BaseObject*>(this)->destroy();
 }
 
Index: /orxonox/trunk/src/lib/lang/base_object.cc
===================================================================
--- /orxonox/trunk/src/lib/lang/base_object.cc	(revision 3530)
+++ /orxonox/trunk/src/lib/lang/base_object.cc	(revision 3531)
@@ -26,5 +26,8 @@
    \brief standard constructor
 */
-BaseObject::BaseObject () {}
+BaseObject::BaseObject () 
+{
+  this->className = NULL;
+}
 
 
@@ -32,6 +35,16 @@
    \brief standard deconstructor
 */
-BaseObject::~BaseObject () {}
+BaseObject::~BaseObject () 
+{
+  this->destroy();
+}
 
+/** 
+    \brief destorys everything BaseObject allocated
+*/
+void BaseObject::destroy(void)
+{
+  //  delete []this->className;
+}
 
 void BaseObject::setClassName (char* className)
Index: /orxonox/trunk/src/lib/lang/base_object.h
===================================================================
--- /orxonox/trunk/src/lib/lang/base_object.h	(revision 3530)
+++ /orxonox/trunk/src/lib/lang/base_object.h	(revision 3531)
@@ -15,5 +15,7 @@
  public:
   BaseObject ();
-  ~BaseObject ();
+  virtual ~BaseObject ();
+
+  void destroy(void);
 
   void setClassName (char* className);
Index: /orxonox/trunk/src/world_entities/npc.h
===================================================================
--- /orxonox/trunk/src/world_entities/npc.h	(revision 3530)
+++ /orxonox/trunk/src/world_entities/npc.h	(revision 3531)
@@ -12,4 +12,5 @@
   NPC ();
   ~NPC ();
+  void destroy(void);
 
   /* collision control */
Index: /orxonox/trunk/src/world_entities/player.cc
===================================================================
--- /orxonox/trunk/src/world_entities/player.cc	(revision 3530)
+++ /orxonox/trunk/src/world_entities/player.cc	(revision 3531)
@@ -37,5 +37,15 @@
 Player::~Player ()
 {
+  this->destroy();
+}
+
+/**
+   \brief deletes all allocated memory of the Player
+*/
+void Player::destroy ()
+{
   delete this->model;
+
+  static_cast<WorldEntity*>(this)->destroy();
 }
 
@@ -72,10 +82,4 @@
 }
 
-/**
-   \brief action that happens when the player is destroyed.
-*/
-void Player::destroy ()
-{
-}
 
 /** 
Index: /orxonox/trunk/src/world_entities/player.h
===================================================================
--- /orxonox/trunk/src/world_entities/player.h	(revision 3530)
+++ /orxonox/trunk/src/world_entities/player.h	(revision 3531)
@@ -18,10 +18,10 @@
  public:
   Player(bool isFree = false);
-  ~Player();
+  virtual ~Player();
+  void destroy();
   
   virtual void postSpawn();
   virtual void tick(float time);
   virtual void hit(WorldEntity* weapon, Vector loc);
-  virtual void destroy();
   virtual void collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags);
   virtual void command(Command* cmd);
Index: /orxonox/trunk/src/world_entities/primitive.cc
===================================================================
--- /orxonox/trunk/src/world_entities/primitive.cc	(revision 3530)
+++ /orxonox/trunk/src/world_entities/primitive.cc	(revision 3531)
@@ -39,4 +39,12 @@
 }
 
+void Primitive::destroy () 
+{
+
+
+  static_cast<WorldEntity*>(this)->destroy();
+}
+
+
 void Primitive::tick (float time) 
 {
@@ -48,5 +56,4 @@
 void Primitive::hit (WorldEntity* weapon, Vector loc) {}
 
-void Primitive::destroy () {}
 
 void Primitive::collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags) {}
Index: /orxonox/trunk/src/world_entities/primitive.h
===================================================================
--- /orxonox/trunk/src/world_entities/primitive.h	(revision 3530)
+++ /orxonox/trunk/src/world_entities/primitive.h	(revision 3531)
@@ -12,9 +12,9 @@
  public:
   Primitive (PRIMITIVE_FORM form);
-  ~Primitive ();
-  
+  virtual ~Primitive ();
+  void destroy(void);
+
   virtual void tick (float time);
   virtual void hit (WorldEntity* weapon, Vector loc);
-  virtual void destroy ();
   virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
   virtual void draw ();
Index: /orxonox/trunk/src/world_entities/skysphere.cc
===================================================================
--- /orxonox/trunk/src/world_entities/skysphere.cc	(revision 3530)
+++ /orxonox/trunk/src/world_entities/skysphere.cc	(revision 3531)
@@ -57,9 +57,16 @@
 Skysphere::~Skysphere()
 {
+  this->destroy();
+}
+
+void Skysphere::destroy(void)
+{
+
   PRINTF(3)("Deleting the SkySphere\n");
   delete skyMaterial;
   free(sphereObj);
+  
+  static_cast<WorldEntity*>(this)->destroy();
 }
-
 
 /**
Index: /orxonox/trunk/src/world_entities/skysphere.h
===================================================================
--- /orxonox/trunk/src/world_entities/skysphere.h	(revision 3530)
+++ /orxonox/trunk/src/world_entities/skysphere.h	(revision 3531)
@@ -28,5 +28,6 @@
   Skysphere();
   Skysphere(char* fileName);
-  ~Skysphere();
+  virtual ~Skysphere();
+  void destroy();
 
   void setRadius(float radius);
Index: /orxonox/trunk/src/world_entities/world_entity.cc
===================================================================
--- /orxonox/trunk/src/world_entities/world_entity.cc	(revision 3530)
+++ /orxonox/trunk/src/world_entities/world_entity.cc	(revision 3531)
@@ -47,5 +47,17 @@
 {
   // if( collisioncluster != NULL) delete collisioncluster;
-}
+  this->destroy();
+}
+
+/**
+   \brief Function to call if a WorldEntity is destroyed. deletes all alocated memory.
+   */
+void WorldEntity::destroy() 
+{
+
+  // delete everything of pNode.
+  static_cast<PNode*>(this)->destroy();
+}
+
 
 /**
@@ -156,10 +168,4 @@
 void WorldEntity::hit(WorldEntity* weapon, Vector loc) {}
 
-/**
-   \brief this function is called when the entity is to be destroied
-   
-   This can be called, if eg. something realy bad happens :)
-*/
-void WorldEntity::destroy() {}
 
 
Index: /orxonox/trunk/src/world_entities/world_entity.h
===================================================================
--- /orxonox/trunk/src/world_entities/world_entity.h	(revision 3530)
+++ /orxonox/trunk/src/world_entities/world_entity.h	(revision 3531)
@@ -21,4 +21,6 @@
   WorldEntity (bool isFree = false);
   virtual ~WorldEntity ();
+  void destroy ();
+
 
   OBJModel* model;                  //!< The model that should be loaded for this entity.
@@ -34,5 +36,4 @@
   virtual void tick (float time);
   virtual void hit (WorldEntity* weapon, Vector loc);
-  virtual void destroy ();
   virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
   virtual void command (Command* cmd);
