From 4116aeeaf0e52331538bee8df7954c35a2e9b66a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 9 May 2024 23:12:36 -0500 Subject: [PATCH] [ox/std] Fix memory leak in Vector (synced from bec75d2eba2a069cd2569e1280211536d31bcd20) --- src/ox/std/vector.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ox/std/vector.hpp b/src/ox/std/vector.hpp index 2d8fee013..5787db694 100644 --- a/src/ox/std/vector.hpp +++ b/src/ox/std/vector.hpp @@ -85,6 +85,8 @@ struct VectorAllocator { constexpr void deallocate(T *items, std::size_t cap) noexcept { // small vector optimization cannot be done it constexpr, but it doesn't really matter in constexpr if (std::is_constant_evaluated()) { + Allocator{}.deallocate(items, cap); + } else { if (items && static_cast(items) != static_cast(m_data.data())) { Allocator{}.deallocate(items, cap); }