From 0133ea30dc1ec35b369ed9802b4aaac5817075f7 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 29 Oct 2021 21:40:58 -0500 Subject: [PATCH] [ox/std] Fix UniquePtr reset to work when copying from a UniquePtr to subclass type --- deps/ox/src/ox/std/memory.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deps/ox/src/ox/std/memory.hpp b/deps/ox/src/ox/std/memory.hpp index 32e47a250..ab64d1a44 100644 --- a/deps/ox/src/ox/std/memory.hpp +++ b/deps/ox/src/ox/std/memory.hpp @@ -56,8 +56,7 @@ class UniquePtr { template constexpr void reset(UniquePtr &&other = UniquePtr()) { auto t = m_t; - m_t = other.m_t; - other.m_t = nullptr; + m_t = other.release(); Deleter()(t); }