diff options
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/retain_ptr.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/fxcrt/retain_ptr.h b/core/fxcrt/retain_ptr.h index e14b1ef5dc..02faff611d 100644 --- a/core/fxcrt/retain_ptr.h +++ b/core/fxcrt/retain_ptr.h @@ -86,6 +86,8 @@ class RetainPtr { // Trivial implementation - internal ref count with virtual destructor. class Retainable { public: + Retainable() = default; + bool HasOneRef() const { return m_nRefCount == 1; } protected: @@ -98,6 +100,9 @@ class Retainable { template <typename U> friend class RetainPtr; + Retainable(const Retainable& that) = delete; + Retainable& operator=(const Retainable& that) = delete; + void Retain() { ++m_nRefCount; } void Release() { ASSERT(m_nRefCount > 0); |