From bb165d2ab45225a78adcf969545c5dc4cc9a6d14 Mon Sep 17 00:00:00 2001 From: hamb3r Date: Mon, 5 Oct 2026 05:06:36 +0300 Subject: [PATCH] test(avplayer): preserve texture allocation accounting --- core/libs/tests/GuestAvPlayer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/libs/tests/GuestAvPlayer.cpp b/core/libs/tests/GuestAvPlayer.cpp index f365faced..30cab7e67 100644 --- a/core/libs/tests/GuestAvPlayer.cpp +++ b/core/libs/tests/GuestAvPlayer.cpp @@ -500,7 +500,6 @@ void Release(void* memory, bool texture) { if (found == allocations.blocks.end() || found->second.texture != texture) std::abort(); aligned = found->second.alignment; allocations.blocks.erase(found); - if (texture) --allocations.textures; } ::operator delete(memory, aligned); } @@ -523,7 +522,9 @@ void SetTextureLimit(std::optional limit) { int TextureCount() { std::lock_guard lock(allocations.mutex); - return allocations.textures; + return static_cast(std::count_if(allocations.blocks.begin(), allocations.blocks.end(), [](const auto& allocation) { + return allocation.second.texture; + })); } struct Events {