1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Prevent accidentally copy/move of refcounted objects

This commit is contained in:
sfan5 2024-08-29 16:13:30 +02:00
parent 62131fe295
commit 3fb4049612
2 changed files with 5 additions and 3 deletions

View file

@ -273,9 +273,7 @@ public:
void grab() noexcept { ++m_refcount; }
void drop() noexcept { if (--m_refcount == 0) delete this; }
// Preserve own reference count.
IntrusiveReferenceCounted(const IntrusiveReferenceCounted &) {}
IntrusiveReferenceCounted &operator=(const IntrusiveReferenceCounted &) { return *this; }
DISABLE_CLASS_COPY(IntrusiveReferenceCounted)
private:
u32 m_refcount = 1;
};