[Orxonox-commit 555] r3097 - trunk/src/network/packet

scheusso at orxonox.net scheusso at orxonox.net
Wed May 27 23:13:17 CEST 2009


Author: scheusso
Date: 2009-05-27 23:13:16 +0200 (Wed, 27 May 2009)
New Revision: 3097

Modified:
   trunk/src/network/packet/Packet.cc
Log:
small possible memory leak closed


Modified: trunk/src/network/packet/Packet.cc
===================================================================
--- trunk/src/network/packet/Packet.cc	2009-05-27 20:40:08 UTC (rev 3096)
+++ trunk/src/network/packet/Packet.cc	2009-05-27 21:13:16 UTC (rev 3097)
@@ -164,7 +164,8 @@
 #endif
 //  ENetPacket *temp = enetPacket_;
 //  enetPacket_ = 0; // otherwise we have a double free because enet already handles the deallocation of the packet
-  Host::addPacket( enetPacket_, clientID_);
+  if(!Host::addPacket( enetPacket_, clientID_))
+    enet_packet_destroy(this->enetPacket_); // if we could not add the packet to the enet queue delete it manually
   return true;
 }
 




More information about the Orxonox-commit mailing list