test(avplayer): preserve texture allocation accounting

This commit is contained in:
hamb3r
2026-10-05 05:06:36 +03:00
parent cf10b5e609
commit bb165d2ab4
+3 -2
View File
@@ -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<int> limit) {
int TextureCount() {
std::lock_guard lock(allocations.mutex);
return allocations.textures;
return static_cast<int>(std::count_if(allocations.blocks.begin(), allocations.blocks.end(), [](const auto& allocation) {
return allocation.second.texture;
}));
}
struct Events {