mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-09 13:14:02 +02:00
Clear buffer (if any). Avoids false-positives with memcheck if buffer
contains old data
This commit is contained in:
parent
5b0b1ad7f7
commit
e5dba942ac
@ -77,6 +77,7 @@ void CConnection::sendPack(const CPack * pack)
|
|||||||
if (!connectionPtr)
|
if (!connectionPtr)
|
||||||
throw std::runtime_error("Attempt to send packet on a closed connection!");
|
throw std::runtime_error("Attempt to send packet on a closed connection!");
|
||||||
|
|
||||||
|
packWriter->buffer.clear();
|
||||||
*serializer & pack;
|
*serializer & pack;
|
||||||
|
|
||||||
logNetwork->trace("Sending a pack of type %s", typeid(*pack).name());
|
logNetwork->trace("Sending a pack of type %s", typeid(*pack).name());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user