From 3e78336af0064a93c66098b492e0e938be5ebac4 Mon Sep 17 00:00:00 2001 From: Mauller <26652186+Mauller@users.noreply.github.com> Date: Mon, 12 Oct 2026 17:36:04 +0100 Subject: [PATCH 1/2] perf(AsciiString): Remove global lock on reference count and replace with atomic variable (#3495) --- .../Google/Core/GoogleBenchmarkMain.cpp | 3 --- Core/GameEngine/Include/Common/AsciiString.h | 7 ++--- .../Source/Common/System/AsciiString.cpp | 26 +++++++++---------- .../Include/Common/CriticalSection.h | 1 - .../Source/Common/System/CriticalSection.cpp | 1 - Generals/Code/Main/WinMain.cpp | 4 +-- .../Include/Common/CriticalSection.h | 1 - .../Source/Common/System/CriticalSection.cpp | 1 - GeneralsMD/Code/Main/WinMain.cpp | 3 +-- Tests/Google/Core/GoogleTestMain.cpp | 3 --- 10 files changed, 19 insertions(+), 31 deletions(-) diff --git a/Benchmarks/Google/Core/GoogleBenchmarkMain.cpp b/Benchmarks/Google/Core/GoogleBenchmarkMain.cpp index f405e1a96df..8c2709f7d8c 100644 --- a/Benchmarks/Google/Core/GoogleBenchmarkMain.cpp +++ b/Benchmarks/Google/Core/GoogleBenchmarkMain.cpp @@ -47,7 +47,6 @@ class EngineCriticalSections public: EngineCriticalSections() { - TheAsciiStringCriticalSection = &m_asciiString; TheUnicodeStringCriticalSection = &m_unicodeString; TheDmaCriticalSection = &m_dma; TheMemoryPoolCriticalSection = &m_memoryPool; @@ -55,14 +54,12 @@ class EngineCriticalSections ~EngineCriticalSections() { - TheAsciiStringCriticalSection = nullptr; TheUnicodeStringCriticalSection = nullptr; TheDmaCriticalSection = nullptr; TheMemoryPoolCriticalSection = nullptr; } private: - CriticalSection m_asciiString; CriticalSection m_unicodeString; CriticalSection m_dma; CriticalSection m_memoryPool; diff --git a/Core/GameEngine/Include/Common/AsciiString.h b/Core/GameEngine/Include/Common/AsciiString.h index 6065881b27e..7505183db7e 100644 --- a/Core/GameEngine/Include/Common/AsciiString.h +++ b/Core/GameEngine/Include/Common/AsciiString.h @@ -49,6 +49,7 @@ #include "Lib/BaseType.h" #include "Common/Debug.h" #include "Common/Errors.h" +#include class UnicodeString; @@ -80,11 +81,11 @@ class AsciiString { private: - // Note, this is a Plain Old Data Structure... don't - // add a ctor/dtor, 'cuz they won't ever be called. + // This header data is allocated in raw storage with an explicit lifetime. + // It is constructed when string data is allocated and destroyed when the string is freed. struct AsciiStringData { - unsigned short m_refCount; // reference count + std::atomic m_refCount; // reference count unsigned short m_numCharsAllocated; // length of data allocated // char m_stringdata[]; diff --git a/Core/GameEngine/Source/Common/System/AsciiString.cpp b/Core/GameEngine/Source/Common/System/AsciiString.cpp index ca53aede056..12ef2de8cd2 100644 --- a/Core/GameEngine/Source/Common/System/AsciiString.cpp +++ b/Core/GameEngine/Source/Common/System/AsciiString.cpp @@ -44,7 +44,6 @@ /////////////////////////////////////////////////////////////////////////////// #include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/CriticalSection.h" #include "WWLib/utf8.h" @@ -121,7 +120,6 @@ static StringCaseInfo getStringCaseInfo(const char *str) // ----------------------------------------------------- AsciiString::AsciiString(const AsciiString& stringSrc) : m_data(stringSrc.m_data) { - ScopedCriticalSection scopedCriticalSection(TheAsciiStringCriticalSection); if (m_data) ++m_data->m_refCount; validate(); @@ -184,7 +182,8 @@ void AsciiString::ensureUniqueBufferOfSize(int numCharsNeeded, Bool preserveData DEBUG_ASSERTCRASH(numCharsNeeded <= MAX_LEN, ("AsciiString::ensureUniqueBufferOfSize exceeds max string length %d with requested length %d", MAX_LEN, numCharsNeeded)); int minBytes = sizeof(AsciiStringData) + numCharsNeeded*sizeof(char); int actualBytes = TheDynamicMemoryAllocator->getActualAllocationSize(minBytes); - AsciiStringData* newData = (AsciiStringData*)TheDynamicMemoryAllocator->allocateBytesDoNotZero(actualBytes, "STR_AsciiString::ensureUniqueBufferOfSize"); + void* rawData = TheDynamicMemoryAllocator->allocateBytesDoNotZero(actualBytes, "STR_AsciiString::ensureUniqueBufferOfSize"); + AsciiStringData* newData = new(rawData) AsciiStringData; newData->m_refCount = 1; newData->m_numCharsAllocated = (actualBytes - sizeof(AsciiStringData))/sizeof(char); @@ -214,16 +213,17 @@ void AsciiString::ensureUniqueBufferOfSize(int numCharsNeeded, Bool preserveData // ----------------------------------------------------- void AsciiString::releaseBuffer() { - ScopedCriticalSection scopedCriticalSection(TheAsciiStringCriticalSection); - validate(); if (m_data) { - if (--m_data->m_refCount == 0) + AsciiStringData* oldData = m_data; + m_data = nullptr; + + if (--oldData->m_refCount == 0) { - TheDynamicMemoryAllocator->freeBytes(m_data); + oldData->~AsciiStringData(); + TheDynamicMemoryAllocator->freeBytes(oldData); } - m_data = nullptr; } validate(); } @@ -253,15 +253,15 @@ AsciiString::AsciiString(const char* s, int len) : m_data(nullptr) // ----------------------------------------------------- void AsciiString::set(const AsciiString& stringSrc) { - ScopedCriticalSection scopedCriticalSection(TheAsciiStringCriticalSection); - validate(); if (&stringSrc != this) { + AsciiStringData* newData = stringSrc.m_data; + if (newData) + ++newData->m_refCount; + releaseBuffer(); - m_data = stringSrc.m_data; - if (m_data) - ++m_data->m_refCount; + m_data = newData; } validate(); } diff --git a/Generals/Code/GameEngine/Include/Common/CriticalSection.h b/Generals/Code/GameEngine/Include/Common/CriticalSection.h index 125c7daee97..c28235e36cf 100644 --- a/Generals/Code/GameEngine/Include/Common/CriticalSection.h +++ b/Generals/Code/GameEngine/Include/Common/CriticalSection.h @@ -94,7 +94,6 @@ class ScopedCriticalSection // These should be null on creation then non-null in WinMain or equivalent. // This allows us to be silently non-threadsafe for WB and other single-threaded apps. -extern CriticalSection *TheAsciiStringCriticalSection; extern CriticalSection *TheUnicodeStringCriticalSection; extern CriticalSection *TheDmaCriticalSection; extern CriticalSection *TheMemoryPoolCriticalSection; diff --git a/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp b/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp index de62b21ad85..0084415e422 100644 --- a/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp @@ -27,7 +27,6 @@ #include "Common/CriticalSection.h" // Definitions. -CriticalSection *TheAsciiStringCriticalSection = nullptr; CriticalSection *TheUnicodeStringCriticalSection = nullptr; CriticalSection *TheDmaCriticalSection = nullptr; CriticalSection *TheMemoryPoolCriticalSection = nullptr; diff --git a/Generals/Code/Main/WinMain.cpp b/Generals/Code/Main/WinMain.cpp index ff5074470da..eef225fb727 100644 --- a/Generals/Code/Main/WinMain.cpp +++ b/Generals/Code/Main/WinMain.cpp @@ -767,7 +767,7 @@ static Bool initializeAppWindows( HINSTANCE hInstance, Int nCmdShow, Bool runWin } // Necessary to allow memory managers and such to have useful critical sections -static CriticalSection critSec1, critSec2, critSec3, critSec4; +static CriticalSection critSec2, critSec3, critSec4; // UnHandledExceptionFilter =================================================== /** Handler for unhandled win32 exceptions. */ @@ -806,7 +806,6 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, // default in a DevStudio project // - TheAsciiStringCriticalSection = &critSec1; TheUnicodeStringCriticalSection = &critSec2; TheDmaCriticalSection = &critSec3; TheMemoryPoolCriticalSection = &critSec4; @@ -911,7 +910,6 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, #ifdef RTS_ENABLE_CRASHDUMP MiniDumper::shutdownMiniDumper(); #endif - TheAsciiStringCriticalSection = nullptr; TheUnicodeStringCriticalSection = nullptr; TheDmaCriticalSection = nullptr; TheMemoryPoolCriticalSection = nullptr; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h b/GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h index 54e79084087..e8ab69a19ac 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h @@ -94,7 +94,6 @@ class ScopedCriticalSection // These should be null on creation then non-null in WinMain or equivalent. // This allows us to be silently non-threadsafe for WB and other single-threaded apps. -extern CriticalSection *TheAsciiStringCriticalSection; extern CriticalSection *TheUnicodeStringCriticalSection; extern CriticalSection *TheDmaCriticalSection; extern CriticalSection *TheMemoryPoolCriticalSection; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/CriticalSection.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/CriticalSection.cpp index 6d7e9125387..7df4fa49a18 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/CriticalSection.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/CriticalSection.cpp @@ -27,7 +27,6 @@ #include "Common/CriticalSection.h" // Definitions. -CriticalSection *TheAsciiStringCriticalSection = nullptr; CriticalSection *TheUnicodeStringCriticalSection = nullptr; CriticalSection *TheDmaCriticalSection = nullptr; CriticalSection *TheMemoryPoolCriticalSection = nullptr; diff --git a/GeneralsMD/Code/Main/WinMain.cpp b/GeneralsMD/Code/Main/WinMain.cpp index 864c5576164..c2803987100 100644 --- a/GeneralsMD/Code/Main/WinMain.cpp +++ b/GeneralsMD/Code/Main/WinMain.cpp @@ -769,7 +769,7 @@ static Bool initializeAppWindows( HINSTANCE hInstance, Int nCmdShow, Bool runWin } // Necessary to allow memory managers and such to have useful critical sections -static CriticalSection critSec1, critSec2, critSec3, critSec4; +static CriticalSection critSec2, critSec3, critSec4; // UnHandledExceptionFilter =================================================== /** Handler for unhandled win32 exceptions. */ @@ -813,7 +813,6 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, // default in a DevStudio project // - TheAsciiStringCriticalSection = &critSec1; TheUnicodeStringCriticalSection = &critSec2; TheDmaCriticalSection = &critSec3; TheMemoryPoolCriticalSection = &critSec4; diff --git a/Tests/Google/Core/GoogleTestMain.cpp b/Tests/Google/Core/GoogleTestMain.cpp index c53d3bf48b2..159985829c4 100644 --- a/Tests/Google/Core/GoogleTestMain.cpp +++ b/Tests/Google/Core/GoogleTestMain.cpp @@ -46,7 +46,6 @@ class EngineCriticalSections public: EngineCriticalSections() { - TheAsciiStringCriticalSection = &m_asciiString; TheUnicodeStringCriticalSection = &m_unicodeString; TheDmaCriticalSection = &m_dma; TheMemoryPoolCriticalSection = &m_memoryPool; @@ -54,14 +53,12 @@ class EngineCriticalSections ~EngineCriticalSections() { - TheAsciiStringCriticalSection = nullptr; TheUnicodeStringCriticalSection = nullptr; TheDmaCriticalSection = nullptr; TheMemoryPoolCriticalSection = nullptr; } private: - CriticalSection m_asciiString; CriticalSection m_unicodeString; CriticalSection m_dma; CriticalSection m_memoryPool; From 1ab0c84ec13b77759c3da25152deb1986dcc6348 Mon Sep 17 00:00:00 2001 From: Mauller <26652186+Mauller@users.noreply.github.com> Date: Mon, 12 Oct 2026 17:37:33 +0100 Subject: [PATCH 2/2] perf(UnicodeString): Remove global lock on reference count and replace with atomic variable (#3495) --- .../Google/Core/GoogleBenchmarkMain.cpp | 3 --- .../GameEngine/Include/Common/UnicodeString.h | 7 ++--- .../Source/Common/System/UnicodeString.cpp | 27 ++++++++++--------- .../Include/Common/CriticalSection.h | 1 - .../Source/Common/System/CriticalSection.cpp | 1 - Generals/Code/Main/WinMain.cpp | 4 +-- .../Include/Common/CriticalSection.h | 1 - .../Source/Common/System/CriticalSection.cpp | 1 - GeneralsMD/Code/Main/WinMain.cpp | 4 +-- Tests/Google/Core/GoogleTestMain.cpp | 3 --- 10 files changed, 20 insertions(+), 32 deletions(-) diff --git a/Benchmarks/Google/Core/GoogleBenchmarkMain.cpp b/Benchmarks/Google/Core/GoogleBenchmarkMain.cpp index 8c2709f7d8c..0db05987906 100644 --- a/Benchmarks/Google/Core/GoogleBenchmarkMain.cpp +++ b/Benchmarks/Google/Core/GoogleBenchmarkMain.cpp @@ -47,20 +47,17 @@ class EngineCriticalSections public: EngineCriticalSections() { - TheUnicodeStringCriticalSection = &m_unicodeString; TheDmaCriticalSection = &m_dma; TheMemoryPoolCriticalSection = &m_memoryPool; } ~EngineCriticalSections() { - TheUnicodeStringCriticalSection = nullptr; TheDmaCriticalSection = nullptr; TheMemoryPoolCriticalSection = nullptr; } private: - CriticalSection m_unicodeString; CriticalSection m_dma; CriticalSection m_memoryPool; }; diff --git a/Core/GameEngine/Include/Common/UnicodeString.h b/Core/GameEngine/Include/Common/UnicodeString.h index 9a12d79708d..952a2017480 100644 --- a/Core/GameEngine/Include/Common/UnicodeString.h +++ b/Core/GameEngine/Include/Common/UnicodeString.h @@ -49,6 +49,7 @@ #include "Lib/BaseType.h" #include "Common/Debug.h" #include "Common/Errors.h" +#include class AsciiString; @@ -80,11 +81,11 @@ class UnicodeString { private: - // Note, this is a Plain Old Data Structure... don't - // add a ctor/dtor, 'cuz they won't ever be called. + // This header data is allocated in raw storage with an explicit lifetime. + // It is constructed when string data is allocated and destroyed when the string is freed. struct UnicodeStringData { - unsigned short m_refCount; // reference count + std::atomic m_refCount; // reference count unsigned short m_numCharsAllocated; // length of data allocated // WideChar m_stringdata[]; diff --git a/Core/GameEngine/Source/Common/System/UnicodeString.cpp b/Core/GameEngine/Source/Common/System/UnicodeString.cpp index 27b7e11c0cb..0c7ca508268 100644 --- a/Core/GameEngine/Source/Common/System/UnicodeString.cpp +++ b/Core/GameEngine/Source/Common/System/UnicodeString.cpp @@ -44,7 +44,6 @@ /////////////////////////////////////////////////////////////////////////////// #include "PreRTS.h" // This must go first in EVERY cpp file in the GameEngine -#include "Common/CriticalSection.h" #include "WWLib/utf8.h" @@ -66,7 +65,6 @@ void UnicodeString::validate() const // ----------------------------------------------------- UnicodeString::UnicodeString(const UnicodeString& stringSrc) : m_data(stringSrc.m_data) { - ScopedCriticalSection scopedCriticalSection(TheUnicodeStringCriticalSection); if (m_data) ++m_data->m_refCount; validate(); @@ -100,7 +98,8 @@ void UnicodeString::ensureUniqueBufferOfSize(int numCharsNeeded, Bool preserveDa DEBUG_ASSERTCRASH(numCharsNeeded <= MAX_LEN, ("UnicodeString::ensureUniqueBufferOfSize exceeds max string length %d with requested length %d", MAX_LEN, numCharsNeeded)); int minBytes = sizeof(UnicodeStringData) + numCharsNeeded*sizeof(WideChar); int actualBytes = TheDynamicMemoryAllocator->getActualAllocationSize(minBytes); - UnicodeStringData* newData = (UnicodeStringData*)TheDynamicMemoryAllocator->allocateBytesDoNotZero(actualBytes, "STR_UnicodeString::ensureUniqueBufferOfSize"); + void* rawData = TheDynamicMemoryAllocator->allocateBytesDoNotZero(actualBytes, "STR_UnicodeString::ensureUniqueBufferOfSize"); + UnicodeStringData* newData = new(rawData) UnicodeStringData; newData->m_refCount = 1; newData->m_numCharsAllocated = (actualBytes - sizeof(UnicodeStringData))/sizeof(WideChar); @@ -130,17 +129,19 @@ void UnicodeString::ensureUniqueBufferOfSize(int numCharsNeeded, Bool preserveDa // ----------------------------------------------------- void UnicodeString::releaseBuffer() { - ScopedCriticalSection scopedCriticalSection(TheUnicodeStringCriticalSection); - validate(); if (m_data) { - if (--m_data->m_refCount == 0) + UnicodeStringData* oldData = m_data; + m_data = nullptr; + + if (--oldData->m_refCount == 0) { - TheDynamicMemoryAllocator->freeBytes(m_data); + oldData->~UnicodeStringData(); + TheDynamicMemoryAllocator->freeBytes(oldData); } - m_data = nullptr; } + validate(); } // ----------------------------------------------------- @@ -167,15 +168,15 @@ UnicodeString::UnicodeString(const WideChar* s, int len) : m_data(nullptr) // ----------------------------------------------------- void UnicodeString::set(const UnicodeString& stringSrc) { - ScopedCriticalSection scopedCriticalSection(TheUnicodeStringCriticalSection); - validate(); if (&stringSrc != this) { + UnicodeStringData* newData = stringSrc.m_data; + if (newData) + ++newData->m_refCount; + releaseBuffer(); - m_data = stringSrc.m_data; - if (m_data) - ++m_data->m_refCount; + m_data = newData; } validate(); } diff --git a/Generals/Code/GameEngine/Include/Common/CriticalSection.h b/Generals/Code/GameEngine/Include/Common/CriticalSection.h index c28235e36cf..bd28f141836 100644 --- a/Generals/Code/GameEngine/Include/Common/CriticalSection.h +++ b/Generals/Code/GameEngine/Include/Common/CriticalSection.h @@ -94,6 +94,5 @@ class ScopedCriticalSection // These should be null on creation then non-null in WinMain or equivalent. // This allows us to be silently non-threadsafe for WB and other single-threaded apps. -extern CriticalSection *TheUnicodeStringCriticalSection; extern CriticalSection *TheDmaCriticalSection; extern CriticalSection *TheMemoryPoolCriticalSection; diff --git a/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp b/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp index 0084415e422..6044bc9a570 100644 --- a/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/CriticalSection.cpp @@ -27,7 +27,6 @@ #include "Common/CriticalSection.h" // Definitions. -CriticalSection *TheUnicodeStringCriticalSection = nullptr; CriticalSection *TheDmaCriticalSection = nullptr; CriticalSection *TheMemoryPoolCriticalSection = nullptr; diff --git a/Generals/Code/Main/WinMain.cpp b/Generals/Code/Main/WinMain.cpp index eef225fb727..9e529a2fa1e 100644 --- a/Generals/Code/Main/WinMain.cpp +++ b/Generals/Code/Main/WinMain.cpp @@ -767,7 +767,7 @@ static Bool initializeAppWindows( HINSTANCE hInstance, Int nCmdShow, Bool runWin } // Necessary to allow memory managers and such to have useful critical sections -static CriticalSection critSec2, critSec3, critSec4; +static CriticalSection critSec3, critSec4; // UnHandledExceptionFilter =================================================== /** Handler for unhandled win32 exceptions. */ @@ -806,7 +806,6 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, // default in a DevStudio project // - TheUnicodeStringCriticalSection = &critSec2; TheDmaCriticalSection = &critSec3; TheMemoryPoolCriticalSection = &critSec4; @@ -910,7 +909,6 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, #ifdef RTS_ENABLE_CRASHDUMP MiniDumper::shutdownMiniDumper(); #endif - TheUnicodeStringCriticalSection = nullptr; TheDmaCriticalSection = nullptr; TheMemoryPoolCriticalSection = nullptr; diff --git a/GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h b/GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h index e8ab69a19ac..3651b2be0e2 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/CriticalSection.h @@ -94,6 +94,5 @@ class ScopedCriticalSection // These should be null on creation then non-null in WinMain or equivalent. // This allows us to be silently non-threadsafe for WB and other single-threaded apps. -extern CriticalSection *TheUnicodeStringCriticalSection; extern CriticalSection *TheDmaCriticalSection; extern CriticalSection *TheMemoryPoolCriticalSection; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/CriticalSection.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/CriticalSection.cpp index 7df4fa49a18..253297b1b06 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/CriticalSection.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/CriticalSection.cpp @@ -27,7 +27,6 @@ #include "Common/CriticalSection.h" // Definitions. -CriticalSection *TheUnicodeStringCriticalSection = nullptr; CriticalSection *TheDmaCriticalSection = nullptr; CriticalSection *TheMemoryPoolCriticalSection = nullptr; diff --git a/GeneralsMD/Code/Main/WinMain.cpp b/GeneralsMD/Code/Main/WinMain.cpp index c2803987100..6a16c6585e5 100644 --- a/GeneralsMD/Code/Main/WinMain.cpp +++ b/GeneralsMD/Code/Main/WinMain.cpp @@ -769,7 +769,7 @@ static Bool initializeAppWindows( HINSTANCE hInstance, Int nCmdShow, Bool runWin } // Necessary to allow memory managers and such to have useful critical sections -static CriticalSection critSec2, critSec3, critSec4; +static CriticalSection critSec3, critSec4; // UnHandledExceptionFilter =================================================== /** Handler for unhandled win32 exceptions. */ @@ -813,7 +813,6 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, // default in a DevStudio project // - TheUnicodeStringCriticalSection = &critSec2; TheDmaCriticalSection = &critSec3; TheMemoryPoolCriticalSection = &critSec4; @@ -939,7 +938,6 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, #ifdef RTS_ENABLE_CRASHDUMP MiniDumper::shutdownMiniDumper(); #endif - TheUnicodeStringCriticalSection = nullptr; TheDmaCriticalSection = nullptr; TheMemoryPoolCriticalSection = nullptr; diff --git a/Tests/Google/Core/GoogleTestMain.cpp b/Tests/Google/Core/GoogleTestMain.cpp index 159985829c4..e328bede416 100644 --- a/Tests/Google/Core/GoogleTestMain.cpp +++ b/Tests/Google/Core/GoogleTestMain.cpp @@ -46,20 +46,17 @@ class EngineCriticalSections public: EngineCriticalSections() { - TheUnicodeStringCriticalSection = &m_unicodeString; TheDmaCriticalSection = &m_dma; TheMemoryPoolCriticalSection = &m_memoryPool; } ~EngineCriticalSections() { - TheUnicodeStringCriticalSection = nullptr; TheDmaCriticalSection = nullptr; TheMemoryPoolCriticalSection = nullptr; } private: - CriticalSection m_unicodeString; CriticalSection m_dma; CriticalSection m_memoryPool; };