From b99aa75ed9b1ec57d5c90ee009f8de8882eeca13 Mon Sep 17 00:00:00 2001 From: Fletcher Dunn Date: Wed, 26 Jan 2022 17:12:57 -0800 Subject: [PATCH] Don't use std_vector for static vectors. Some implementations of std::vector do dumb stuff and the default constructor actually allocates memory. (Uggggggg.) This causes problems if an app wants to set a custom memory allocator, because by the time they do that these vectors will have already allocated memory, and then if that memory needs to be reallocated, by the custom allocator, we run into problems. This fixes #209 P4:7032464 --- .../clientlib/steamnetworkingsockets_connections.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_connections.cpp b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_connections.cpp index b1ca419e..cd9ddbdc 100644 --- a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_connections.cpp +++ b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_connections.cpp @@ -632,7 +632,7 @@ CSteamNetworkConnectionBase::~CSteamNetworkConnectionBase() } } -static std_vector s_vecPendingDeleteConnections; +static std::vector s_vecPendingDeleteConnections; static ShortDurationLock s_lockPendingDeleteConnections( "connection_delete_queue" ); void CSteamNetworkConnectionBase::ConnectionQueueDestroy() @@ -661,7 +661,7 @@ void CSteamNetworkConnectionBase::ProcessDeletionList() // want us to take a ShortDurationLock and then take any // other locks. s_lockPendingDeleteConnections.lock(); - std_vector vecTemp( std::move( s_vecPendingDeleteConnections ) ); + std::vector vecTemp( std::move( s_vecPendingDeleteConnections ) ); s_vecPendingDeleteConnections.clear(); s_lockPendingDeleteConnections.unlock();