diff options
| -rw-r--r-- | binaryninjaapi.h | 18 | ||||
| -rw-r--r-- | ui/xreflist.h | 2 |
2 files changed, 9 insertions, 11 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 9cd6475a..e16158cc 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -253,20 +253,18 @@ namespace BinaryNinja Ref<T>& operator=(Ref<T>&& other) { - if (this != &other) + if (m_obj) { - 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; #ifdef BN_REF_COUNT_DEBUG - m_assignmentTrace = other.m_assignmentTrace; + BNUnregisterObjectRefDebugTrace(typeid(T).name(), m_assignmentTrace); #endif + m_obj->Release(); } + m_obj = other.m_obj; + other.m_obj = 0; +#ifdef BN_REF_COUNT_DEBUG + m_assignmentTrace = other.m_assignmentTrace; +#endif return *this; } diff --git a/ui/xreflist.h b/ui/xreflist.h index 73ae48ef..76942954 100644 --- a/ui/xreflist.h +++ b/ui/xreflist.h @@ -240,7 +240,7 @@ class BINARYNINJAUIAPI CrossReferenceTreeModel : public QAbstractItemModel public: CrossReferenceTreeModel(QWidget* parent, BinaryViewRef data, ViewFrame* view); - virtual ~CrossReferenceTreeModel() {} + virtual ~CrossReferenceTreeModel(); virtual QModelIndex index(int row, int col, const QModelIndex& parent = QModelIndex()) const override; virtual QVariant data(const QModelIndex& i, int role) const override; |
