fix: fix handle's copy constructors

This commit is contained in:
2026-07-04 16:14:46 +02:00
parent f5ebc767ab
commit cf284592fd
+6 -2
View File
@@ -148,7 +148,9 @@ public:
*/ */
handle(const handle& other) handle(const handle& other)
: m_value(other.m_value) { : m_value(other.m_value) {
m_value->first.acquire(); if constexpr (detail::header_has_refcount_v<Header>) {
m_value->first.acquire();
}
} }
/** /**
@@ -157,7 +159,9 @@ public:
handle& operator=(const handle& other) { handle& operator=(const handle& other) {
if (this == &other) return *this; if (this == &other) return *this;
m_value = other.m_value; m_value = other.m_value;
m_value->first.acquire(); if constexpr (detail::header_has_refcount_v<Header>) {
m_value->first.acquire();
}
return *this; return *this;
} }
public: public: