From e886208d6431b0916f6a4332f894bba68d4e6f9e Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 18 Mar 2023 15:40:04 +0100 Subject: [PATCH] Remove extraneous destructor This caused the 'CUtlBinaryBlock' destructor to be called twice (freeing memory on the same pointer twice). Destructor should only be called explicitly in 'CUtlBinaryBlock' itself to purge vector memory due to late binding of game's memalloc singleton. --- r5dev/tier1/utlstring.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/r5dev/tier1/utlstring.h b/r5dev/tier1/utlstring.h index 4819119b..2460adc2 100644 --- a/r5dev/tier1/utlstring.h +++ b/r5dev/tier1/utlstring.h @@ -175,17 +175,6 @@ public: CUtlString( CUtlString&& moveFrom ); // = default; CUtlString &operator=( CUtlString&& moveFrom ); // = default; #endif - ~CUtlString() - { - // Has to be explicitly called due to the - // current design of our SDK. Unlike other - // Source Engine games, we couldn't import - // the memalloc singleton as the executable - // is monolithic; we obtain it post init - // (too late for binding it against the - // new/delete operators..). - m_Storage.~CUtlBinaryBlock(); - } // Also can assign from a regular C-style string CUtlString &operator=( const char *src );