1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

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

contains old data
This commit is contained in:
Ivan Savenko 2024-06-12 18:13:21 +00:00
parent 5b0b1ad7f7
commit e5dba942ac

View File

@ -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());