Index: orxonox/branches/parenting/src/p_node.cc
===================================================================
--- orxonox/branches/parenting/src/p_node.cc	(revision 3276)
+++ orxonox/branches/parenting/src/p_node.cc	(revision 3277)
@@ -69,6 +69,30 @@
 PNode::~PNode () 
 {
-  this->children->destroy();
-  delete this->children;
+  /*
+  delete &this->children;
+  delete &this->relCoordinate;
+  delete &this->absCoordinate;
+  delete &this->relDirection;
+  delete &this->absDirection;
+  */
+  this->parent = NULL;
+  /* there is currently a problem with cleaning up - fix*/
+}
+
+
+/**
+   \brief deletes the hole pnode tree
+
+   cleans up all pnodes
+*/
+void PNode::destroy ()
+{
+  PNode* pn = this->children->enumerate();
+  while( pn != NULL) 
+    { 
+      pn->destroy ();
+      pn = this->children->nextElement();
+    } 
+  this->children->destroy ();
 }
 
Index: orxonox/branches/parenting/src/p_node.h
===================================================================
--- orxonox/branches/parenting/src/p_node.h	(revision 3276)
+++ orxonox/branches/parenting/src/p_node.h	(revision 3277)
@@ -34,5 +34,7 @@
   PNode ();
   PNode (Vector* absCoordinate, PNode* pNode);
-  ~PNode ();
+  virtual ~PNode ();
+
+  void destroy ();
 
   PNode* parent; //! a pointer to the parent node
Index: orxonox/branches/parenting/src/world.cc
===================================================================
--- orxonox/branches/parenting/src/world.cc	(revision 3276)
+++ orxonox/branches/parenting/src/world.cc	(revision 3277)
@@ -67,4 +67,7 @@
   this->entities->destroy();
 
+  /* FIX the parent list has to be cleared - not possible if we got the old list also*/
+  //this->nullParent->destroy ();
+
   delete this->entities;
   delete this->localCamera;
@@ -82,5 +85,5 @@
 
   /* this is only for test purposes */
-  //this->debug ();
+  this->debug ();
 }
 
@@ -128,4 +131,6 @@
 	case DEBUG_WORLD_0:
 	  {
+	    this->nullParent = new NullParent ();
+
 	    // create some path nodes
 	    this->pathnodes = new Vector[6];
@@ -146,6 +151,4 @@
 	    // !\todo old track-system has to be removed
 
-	    //this->nullParent = new NullParent ();
-
 	    // create a player
 	    WorldEntity* myPlayer = new Player();
@@ -160,5 +163,6 @@
 	    this->localCamera = new Camera(this);
 	    this->getCamera()->bind (myPlayer);	
-
+	    
+	    /*
 	    Placement* plc = new Placement;
 	    plc->r = Vector(100, 10, 10);
@@ -166,4 +170,5 @@
 	    WorldEntity* env = new Environment();
 	    this->spawn(env, plc);
+	    */
 
 	    break;
@@ -171,4 +176,6 @@
 	case DEBUG_WORLD_1:
 	  {
+	    this->nullParent = new NullParent ();
+
 	    // create some path nodes
 	    this->pathnodes = new Vector[6];
@@ -622,4 +629,8 @@
   p3->debug ();
   p4->debug ();
+
+  p1->destroy ();
+  
+  
   /*
   WorldEntity* entity;
@@ -778,4 +789,7 @@
   WorldEntity* owner;
 
+  if( this->nullParent != NULL)
+    this->nullParent->addChild (entity);
+
   entities->add (entity);
   zeroloc.dist = 0;
@@ -800,4 +814,7 @@
 void World::spawn(WorldEntity* entity, Location* loc)
 {
+  if( this->nullParent != NULL)
+    this->nullParent->addChild (entity);
+
   Location zeroLoc;
   WorldEntity* owner;
@@ -828,4 +845,7 @@
 void World::spawn(WorldEntity* entity, Placement* plc)
 {
+  if( this->nullParent != NULL)
+    this->nullParent->addChild (entity);
+
   Placement zeroPlc;
   WorldEntity* owner;
Index: orxonox/branches/parenting/src/world_entity.h
===================================================================
--- orxonox/branches/parenting/src/world_entity.h	(revision 3276)
+++ orxonox/branches/parenting/src/world_entity.h	(revision 3277)
@@ -8,16 +8,18 @@
 
 #include "stdincl.h"
+#include "p_node.h"
 
 class CollisionCluster;
 
 //! Basic class from which all interactive stuff in the world is derived from
-class WorldEntity
+class WorldEntity : public PNode
 {	
   friend class World;
-  
+
  public:
   WorldEntity (bool isFree = false);
   virtual ~WorldEntity ();
   
+  //PNode* pNode;
   Location* getLocation ();
   Placement* getPlacement ();
