From c2c4b2b7948f8d4a63ad2bcdda8ffad584fb9cf6 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 27 Aug 2024 20:45:36 +0300 Subject: [PATCH] fix: release unused memory in `CNetMsgMaker::Make()` --- src/netmessagemaker.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/netmessagemaker.h b/src/netmessagemaker.h index d2de8bee6b..3fbe857569 100644 --- a/src/netmessagemaker.h +++ b/src/netmessagemaker.h @@ -21,6 +21,7 @@ public: msg.m_type = std::move(msg_type); msg.data.reserve(4 * 1024); CVectorWriter{ SER_NETWORK, nFlags | nVersion, msg.data, 0, std::forward(args)... }; + msg.data.shrink_to_fit(); return msg; }