diff options
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index e4af4672..29f7c3b1 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -241,6 +241,14 @@ namespace BinaryNinja } } + Ref<T>(Ref<T>&& other) : m_obj(other.m_obj) + { + other.m_obj = 0; +#ifdef BN_REF_COUNT_DEBUG + m_assignmentTrace = other.m_assignmentTrace; +#endif + } + ~Ref<T>() { if (m_obj) @@ -269,6 +277,22 @@ namespace BinaryNinja return *this; } + Ref<T>& operator=(Ref<T>&& other) + { + if (this != &other) + { + if (!m_obj) + m_obj = other.m_obj; + else if (m_obj != other.m_obj) + { + m_obj->Release(); + m_obj = other.m_obj; + } + other.m_obj = 0; + } + return *this; + } + Ref<T>& operator=(T* obj) { #ifdef BN_REF_COUNT_DEBUG |
