From cf284592fd84f4e3618e79e6a9ed11b1721588e0 Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Sat, 4 Jul 2026 16:14:46 +0200 Subject: [PATCH] fix: fix handle's copy constructors --- furvm/include/furvm/handle.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/furvm/include/furvm/handle.hpp b/furvm/include/furvm/handle.hpp index 0230ef2..17993b2 100644 --- a/furvm/include/furvm/handle.hpp +++ b/furvm/include/furvm/handle.hpp @@ -148,7 +148,9 @@ public: */ handle(const handle& other) : m_value(other.m_value) { - m_value->first.acquire(); + if constexpr (detail::header_has_refcount_v
) { + m_value->first.acquire(); + } } /** @@ -157,7 +159,9 @@ public: handle& operator=(const handle& other) { if (this == &other) return *this; m_value = other.m_value; - m_value->first.acquire(); + if constexpr (detail::header_has_refcount_v
) { + m_value->first.acquire(); + } return *this; } public: