Jelajahi Sumber

Clear buffer (if any). Avoids false-positives with memcheck if buffer
contains old data

Ivan Savenko 1 tahun lalu
induk
melakukan
e5dba942ac
1 mengubah file dengan 1 tambahan dan 0 penghapusan
  1. 1 0
      lib/serializer/Connection.cpp

+ 1 - 0
lib/serializer/Connection.cpp

@@ -77,6 +77,7 @@ void CConnection::sendPack(const CPack * pack)
 	if (!connectionPtr)
 		throw std::runtime_error("Attempt to send packet on a closed connection!");
 
+	packWriter->buffer.clear();
 	*serializer & pack;
 
 	logNetwork->trace("Sending a pack of type %s", typeid(*pack).name());