summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2025-04-14 08:33:03 -0400
committerPeter LaFosse <peter@vector35.com>2025-04-29 09:16:13 -0400
commit6697a9d2ce4bf7d544f98dafea7edfaecd7b6731 (patch)
tree722cbb75a8331131caa1e57588815a3121f4bbc5 /binaryview.cpp
parentd1722c0b34f313590f1f5a1274985433a58a7a5f (diff)
Fix memory leaks in Sections, Segments, Settings, ExternalLibrary, and BackgroundTask
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index 9a223932..242b2a01 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -3835,7 +3835,7 @@ Ref<BackgroundTask> BinaryView::GetBackgroundAnalysisTask()
if (!task)
return nullptr;
- return new BackgroundTask(BNNewBackgroundTaskReference(task));
+ return new BackgroundTask(task);
}
@@ -4954,7 +4954,7 @@ Ref<Segment> BinaryView::GetSegmentAt(uint64_t addr)
if (!segment)
return nullptr;
- return new Segment(BNNewSegmentReference(segment));
+ return new Segment(segment);
}
@@ -5043,7 +5043,7 @@ Ref<Section> BinaryView::GetSectionByName(const string& name)
{
BNSection* section = BNGetSectionByName(m_object, name.c_str());
if (section)
- return new Section(BNNewSectionReference(section));
+ return new Section(section);
return nullptr;
}
@@ -5386,7 +5386,7 @@ Ref<ExternalLibrary> BinaryView::AddExternalLibrary(const std::string& name, Ref
BNExternalLibrary* lib = BNBinaryViewAddExternalLibrary(m_object, name.c_str(), backingFile ? backingFile->m_object : nullptr, isAuto);
if (!lib)
return nullptr;
- return new ExternalLibrary(BNNewExternalLibraryReference(lib));
+ return new ExternalLibrary(lib);
}