Index: code/branches/objecthierarchy/src/network/ConnectionManager.cc
===================================================================
--- code/branches/objecthierarchy/src/network/ConnectionManager.cc	(revision 2156)
+++ code/branches/objecthierarchy/src/network/ConnectionManager.cc	(revision 2164)
@@ -138,5 +138,5 @@
 
   bool ConnectionManager::addPacket(ENetPacket *packet, ENetPeer *peer) {
-    boost::recursive_mutex::scoped_lock lock(instance_->enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
     if(enet_peer_send(peer, NETWORK_DEFAULT_CHANNEL, packet)!=0)
       return false;
@@ -156,5 +156,5 @@
     if(!instance_)
       return false;
-    boost::recursive_mutex::scoped_lock lock(instance_->enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
     for(ClientInformation *i=ClientInformation::getBegin()->next(); i!=0; i=i->next()){
       COUT(3) << "adding broadcast packet for client: " << i->getID() << std::endl;
@@ -169,5 +169,5 @@
     if(server==NULL || !instance_)
       return false;
-    boost::recursive_mutex::scoped_lock lock(enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
     enet_host_flush(server);
     lock.unlock();
@@ -180,5 +180,5 @@
     atexit(enet_deinitialize);
     { //scope of the mutex
-      boost::recursive_mutex::scoped_lock lock(enet_mutex);
+      boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
       enet_initialize();
       server = enet_host_create(&bindAddress, NETWORK_MAX_CONNECTIONS, 0, 0);
@@ -194,5 +194,5 @@
     while(!quit){
       { //mutex scope
-        boost::recursive_mutex::scoped_lock lock(enet_mutex);
+        boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
         if(enet_host_service(server, event, NETWORK_WAIT_TIMEOUT)<0){
           // we should never reach this point
@@ -236,5 +236,5 @@
     // if we're finishied, destroy server
     {
-      boost::recursive_mutex::scoped_lock lock(enet_mutex);
+      boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
       enet_host_destroy(server);
       lock.unlock();
@@ -250,5 +250,5 @@
     while(temp!=0){
       {
-        boost::recursive_mutex::scoped_lock lock(enet_mutex);
+        boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
         enet_peer_disconnect(temp->getPeer(), 0);
         lock.unlock();
@@ -258,5 +258,5 @@
     //bugfix: might be the reason why server crashes when clients disconnects
     temp = ClientInformation::getBegin()->next();
-    boost::recursive_mutex::scoped_lock lock(enet_mutex);
+    boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
     while( temp!=0 && enet_host_service(server, &event, NETWORK_WAIT_TIMEOUT) >= 0){
       switch (event.type)
@@ -332,5 +332,5 @@
   void ConnectionManager::disconnectClient(ClientInformation *client){
     {
-      boost::recursive_mutex::scoped_lock lock(enet_mutex);
+      boost::recursive_mutex::scoped_lock lock(ConnectionManager::enet_mutex);
       enet_peer_disconnect(client->getPeer(), 0);
       lock.unlock();
Index: code/branches/objecthierarchy/src/network/packet/Packet.cc
===================================================================
--- code/branches/objecthierarchy/src/network/packet/Packet.cc	(revision 2156)
+++ code/branches/objecthierarchy/src/network/packet/Packet.cc	(revision 2164)
@@ -54,4 +54,5 @@
 
 std::map<size_t, Packet *> Packet::packetMap_;
+boost::recursive_mutex Packet::packetMap_mutex;
 
 Packet::Packet(){
@@ -128,4 +129,7 @@
       return false;
     }
+    // Assures we don't create a packet and destroy it right after in another thread
+    // without having a reference in the packetMap_
+    boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex);
     // We deliver ENet the data address so that it doesn't memcpy everything again.
     // --> We have to delete data_ ourselves!
@@ -207,4 +211,5 @@
 */
 void Packet::deletePacket(ENetPacket *enetPacket){
+  boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex);
   // Get our Packet from a gloabal map with all Packets created in the send() method of Packet.
   std::map<size_t, Packet*>::iterator it = packetMap_.find((size_t)enetPacket);
@@ -213,5 +218,5 @@
   it->second->enetPacket_ = 0;
   delete it->second;
-  //packetMap_.erase(it);
+  packetMap_.erase(it);
   COUT(4) << "PacketMap size: " << packetMap_.size() << std::endl;
 }
Index: code/branches/objecthierarchy/src/network/packet/Packet.h
===================================================================
--- code/branches/objecthierarchy/src/network/packet/Packet.h	(revision 2156)
+++ code/branches/objecthierarchy/src/network/packet/Packet.h	(revision 2164)
@@ -29,8 +29,9 @@
 #define NETWORKPACKET_H
 
-#include "../NetworkPrereqs.h"
+#include "network/NetworkPrereqs.h"
 
 #include <map>
 #include <enet/enet.h>
+#include <boost/thread/recursive_mutex.hpp>
 
 #include "util/Integers.h"
@@ -93,4 +94,6 @@
   private:
     static std::map<size_t, Packet *> packetMap_;
+    //! Static mutex for any packetMap_ access
+    static boost::recursive_mutex packetMap_mutex;
     ENetPacket *enetPacket_;
 };
