Index: code/branches/network3/src/network/Client.cc
===================================================================
--- code/branches/network3/src/network/Client.cc	(revision 1246)
+++ code/branches/network3/src/network/Client.cc	(revision 1248)
@@ -84,5 +84,5 @@
     // set server address to localhost
     isConnected=false;
-    test_once=false;
+    isSynched_=false;
   }
 
@@ -94,5 +94,5 @@
   Client::Client(std::string address, int port) : client_connection(port, address){
     isConnected=false;
-    test_once=false;
+    isSynched_=false;
   }
 
@@ -104,5 +104,5 @@
   Client::Client(const char *address, int port) : client_connection(port, address){
     isConnected=false;
-    test_once=false;
+    isSynched_=false;
   }
 
@@ -229,5 +229,5 @@
   */
   void Client::tick(float time){
-    if(client_connection.isConnected()){
+    if(client_connection.isConnected() && isSynched_){
       COUT(4) << "popping partial gamestate: " << std::endl;
       GameStateCompressed *gs = gamestate.popPartialGameState();
@@ -246,7 +246,5 @@
       packet = client_connection.getPacket();
       COUT(5) << "tick packet size " << packet->dataLength << std::endl;
-      if(!test_once){
-        elaborate(packet, 0); // ================= i guess we got to change this .... (client_ID is always same = server)
-      }
+      elaborate(packet, 0); // ================= i guess we got to change this .... (client_ID is always same = server)
     }
     if(!client_connection.sendPackets())
@@ -256,14 +254,13 @@
 
   void Client::processGamestate( GameStateCompressed *data, int clientID){
-    if(!test_once){
-      int id = data->id;
-      COUT(5) << "received gamestate id: " << data->id << std::endl;
-      if(gamestate.pushGameState(data)){
-        client_connection.addPacket(pck_gen.acknowledgement(id));
+    int id = data->id;
+    COUT(5) << "received gamestate id: " << data->id << std::endl;
+    if(gamestate.pushGameState(data)){
+      if(!isSynched_)
+        isSynched_=true;
+      client_connection.addPacket(pck_gen.acknowledgement(id));
         // we do this at the end of a tick
-//        if(!client_connection.sendPackets())
-//          COUT(2) << "Could not send acknowledgment" << std::endl;
-      }
-//       test_once=true;
+       if(!client_connection.sendPackets())
+         COUT(2) << "Could not send acknowledgment" << std::endl;
     }
   }
@@ -275,4 +272,5 @@
       id->setNetworkID(clid->clid);
     COUT(4) << "Client: received and set network id: " << clid->clid << "; classname: " << clid->message << std::endl;
+    delete clid;
     return;
   }
@@ -280,4 +278,6 @@
   void Client::processChat( chat *data){
     COUT(0) << "Server: " << data->message << std::endl;
+    delete[] data->message;
+    delete data;
   }
   
@@ -286,4 +286,5 @@
     clientID_ = w->clientID;
     shipID_ = w->shipID;
+    delete w;
     return true;
   }
Index: code/branches/network3/src/network/Client.h
===================================================================
--- code/branches/network3/src/network/Client.h	(revision 1246)
+++ code/branches/network3/src/network/Client.h	(revision 1248)
@@ -101,4 +101,5 @@
     GameStateClient gamestate;
     bool isConnected;
+    bool isSynched_;
 
     // implement data processing functions of PacketDecoder
@@ -109,5 +110,4 @@
     int clientID_;     // this is the id the server gave to us
     int shipID_;
-    bool test_once;
   };
 
Index: code/branches/network3/src/network/GameStateManager.cc
===================================================================
--- code/branches/network3/src/network/GameStateManager.cc	(revision 1246)
+++ code/branches/network3/src/network/GameStateManager.cc	(revision 1248)
@@ -261,6 +261,4 @@
     }
     
-    delete[] state->data;
-    delete state;
     return true;
   }
Index: code/branches/network3/src/network/PacketDecoder.cc
===================================================================
--- code/branches/network3/src/network/PacketDecoder.cc	(revision 1246)
+++ code/branches/network3/src/network/PacketDecoder.cc	(revision 1248)
@@ -90,4 +90,6 @@
     return false;
   }
+  
+  // ATTENTION: TODO watch, that arguments we pass over to the processFunction gets deleted in THE PROCESSXXX function
 
   //following are the decode functions for the data of the packets
@@ -101,5 +103,4 @@
     COUT(4) << "PacketDecoder: got ack id: " << a->a << std::endl;
     processAck( a, clientId ); //debug info
-
     //clean memory
     enet_packet_destroy( packet );
@@ -121,5 +122,4 @@
     //clean memory
     enet_packet_destroy( packet );
-
     printMouse( mouseMove ); //debug info
   }
@@ -132,5 +132,4 @@
     //clean memory
     enet_packet_destroy( packet );
-
     printKey( key ); //debug info
 
@@ -232,10 +231,14 @@
   {
     printChat(data, clientId);
+    delete[] data->message;
+    delete data;
   }
 
   void PacketDecoder::processGamestate( GameStateCompressed *state, int clientID )
   {
-    COUT(5) << "PacketDecoder: processing Gamestate" << std::endl;
+    COUT(3) << "PacketDecoder-process: processing Gamestate" << std::endl;
     //printGamestate( state );
+    delete[] state->data;
+    delete state;
   }
 
@@ -243,4 +246,5 @@
   {
     printClassid(cid);
+    delete cid;
     return;
   }
@@ -249,8 +253,10 @@
   {
     printAck(data);
+    delete data;
     return;
   }
   
   bool PacketDecoder::processWelcome( welcome *w ){
+    delete w;
     return true;
   }
@@ -258,4 +264,5 @@
   bool PacketDecoder::processConnectRequest( connectRequest *con, int clientID ){
     COUT(3) << "packetdecoder: processing connectRequest" << std::endl;
+    delete con;
     return true;
   }
Index: code/branches/network3/src/network/PacketGenerator.cc
===================================================================
--- code/branches/network3/src/network/PacketGenerator.cc	(revision 1246)
+++ code/branches/network3/src/network/PacketGenerator.cc	(revision 1248)
@@ -58,5 +58,5 @@
 
     ENetPacket *packet = enet_packet_create( ackreq , sizeof( *ackreq ), reliable );
-
+    delete ackreq;
     return packet;
   }
@@ -71,5 +71,7 @@
     memcpy((unsigned char *)stream+sizeof(int), (void*)&dataLength, sizeof(int));
     memcpy((unsigned char *)stream+2*sizeof(int), data, dataLength);
-    return enet_packet_create(stream, dataLength+2*sizeof(int), reliable);
+    ENetPacket *packet = enet_packet_create(stream, dataLength+2*sizeof(int), reliable);
+    delete[] stream; // TODO: we could also tell enet not to copy the data, but to use the exisiting memory
+    return packet;
   }
 
@@ -84,5 +86,5 @@
 
     ENetPacket *packet = enet_packet_create( mousemove , sizeof( *mousemove ), reliable );
-
+    delete mousemove;
     return packet;
   }
@@ -97,5 +99,5 @@
 
     ENetPacket *packet = enet_packet_create( key , sizeof( *key ), reliable );
-
+    delete key;
     return packet;
   }
@@ -109,5 +111,5 @@
     memcpy( &trans[1], (const void*)message, strlen( message ) + 1);
     ENetPacket *packet = enet_packet_create( trans , sizeof( int ) + strlen( message ) + 1, reliable );
-
+    delete[] trans;
     return packet;
   }
@@ -136,5 +138,5 @@
     COUT(4) << "PacketGenerator generating totalLen " << totalLen << std::endl;
     ENetPacket *packet = enet_packet_create( data , totalLen, reliable );
-    //delete data;
+    delete[] data;
     return packet;
   }
@@ -150,4 +152,5 @@
     memcpy( (void *)(data+3*sizeof(int)), classname.c_str(), classname.length()+1);
     ENetPacket *packet = enet_packet_create( data , 3*sizeof(int)+classname.length()+1, reliable );
+    delete[] data;
     return packet;
   }
@@ -160,4 +163,5 @@
     wc->allowed = true;
     ENetPacket *packet = enet_packet_create( wc, sizeof(welcome), reliable);
+    delete wc;
     return packet;
   }
@@ -166,5 +170,7 @@
     connectRequest *con = new connectRequest;
     con->id=CONNECT;
-    return enet_packet_create( con, sizeof(connectRequest), reliable);
+    ENetPacket *packet = enet_packet_create( con, sizeof(connectRequest), reliable);
+    delete con;
+    return packet;
   }
 
Index: code/branches/network3/src/network/Server.cc
===================================================================
--- code/branches/network3/src/network/Server.cc	(revision 1246)
+++ code/branches/network3/src/network/Server.cc	(revision 1248)
@@ -232,4 +232,5 @@
     //connection->addPacket(packet_gen.gstate(gamestates->popGameState(clientID)) , clientID);
     connection->createClient(clientID);
+    delete con;
     return true;
   }
@@ -239,4 +240,6 @@
     if(!gamestates->pushGameState(data, clientID))
         COUT(3) << "Could not push gamestate\t\t\t\t=====" << std::endl;
+    delete[] data->data;
+    delete data;
   }
 
Index: code/branches/network3/src/network/Synchronisable.cc
===================================================================
--- code/branches/network3/src/network/Synchronisable.cc	(revision 1246)
+++ code/branches/network3/src/network/Synchronisable.cc	(revision 1248)
@@ -166,5 +166,5 @@
       //(std::memcpy(retVal.data+n, (const void*)(&(i->size)), sizeof(int));
       if( ((*i)->mode & state_) == 0 ){
-        COUT(4) << "not getting data: " << std::endl;
+        COUT(5) << "not getting data: " << std::endl;
         continue;  // this variable should only be received
       }
