From 74e6df96d4c2736d574927ebf7aa18d83b587201 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:24:12 +0300 Subject: [PATCH] Fix shared string memory leak. --- .../api/Hedgehog/Base/Type/detail/hhStringHolder.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnleashedRecomp/api/Hedgehog/Base/Type/detail/hhStringHolder.inl b/UnleashedRecomp/api/Hedgehog/Base/Type/detail/hhStringHolder.inl index 5bd4755..287f530 100644 --- a/UnleashedRecomp/api/Hedgehog/Base/Type/detail/hhStringHolder.inl +++ b/UnleashedRecomp/api/Hedgehog/Base/Type/detail/hhStringHolder.inl @@ -61,7 +61,7 @@ namespace Hedgehog::Base decrementedValue = ByteSwap(ByteSwap(originalValue) - 1); } while (InterlockedCompareExchange(reinterpret_cast(&RefCountAndLength), decrementedValue, originalValue) != originalValue); - if (RefCountAndLength == 0) + if ((decrementedValue & 0xFFFF0000) == 0) __HH_FREE(this); }