소스 검색

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

Ivan Savenko 1 년 전
부모
커밋
e5dba942ac
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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());