From fd40266f767e51e649fb48376e25f47a60d79765 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Mon, 11 May 2026 18:49:26 -0700 Subject: Fix incorrect reference counting in C++ API --- debuginfo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'debuginfo.cpp') diff --git a/debuginfo.cpp b/debuginfo.cpp index e0ab328c..3a337bc7 100644 --- a/debuginfo.cpp +++ b/debuginfo.cpp @@ -371,7 +371,7 @@ Ref DebugInfoParser::GetByName(const string& name) { BNDebugInfoParser* parser = BNGetDebugInfoParserByName(name.c_str()); if (parser) - return new DebugInfoParser(BNNewDebugInfoParserReference(parser)); + return new DebugInfoParser(parser); return nullptr; } @@ -472,6 +472,5 @@ bool CustomDebugInfoParser::ParseCallback(void* ctxt, BNDebugInfo* debugInfo, BN CustomDebugInfoParser::CustomDebugInfoParser(const string& name) : - DebugInfoParser( - BNNewDebugInfoParserReference(BNRegisterDebugInfoParser(name.c_str(), IsValidCallback, ParseCallback, this))) + DebugInfoParser(BNRegisterDebugInfoParser(name.c_str(), IsValidCallback, ParseCallback, this)) {} -- cgit v1.3.1