summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index a5ad242d..c5724621 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -165,9 +165,10 @@ namespace BinaryNinja {
void Release()
{
- if (m_object)
- FreeObjectReference(m_object);
+ T* obj = m_object;
ReleaseInternal();
+ if (obj)
+ FreeObjectReference(obj);
}
void AddRefForRegistration() { m_registeredRef = true; }