Skip to content

Commit 3228382

Browse files
committed
[RTTI] Fix leak of BackgroundTask
1 parent a3af191 commit 3228382

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/rtti/itanium.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ ItaniumRTTIProcessor::ItaniumRTTIProcessor(const Ref<BinaryView> &view, bool use
731731

732732
void ItaniumRTTIProcessor::ProcessRTTI()
733733
{
734-
auto bgTask = new BackgroundTask("Scanning for Itanium RTTI...", true);
734+
Ref<BackgroundTask> bgTask = new BackgroundTask("Scanning for Itanium RTTI...", true);
735735
auto start_time = std::chrono::high_resolution_clock::now();
736736
auto addrSize = m_view->GetAddressSize();
737737
uint64_t maxTypeInfoSize = TypeInfoSize(m_view);
@@ -820,7 +820,7 @@ void ItaniumRTTIProcessor::ProcessRTTI()
820820

821821
void ItaniumRTTIProcessor::ProcessVFT()
822822
{
823-
auto bgTask = new BackgroundTask("Scanning for Itanium VFTs...", true);
823+
Ref<BackgroundTask> bgTask = new BackgroundTask("Scanning for Itanium VFTs...", true);
824824
BinaryReader optReader = BinaryReader(m_view);
825825
std::map<uint64_t, std::set<uint64_t>> vftMap = {};
826826
std::map<uint64_t, std::optional<VirtualFunctionTableInfo>> vftFinishedMap = {};

plugins/rtti/microsoft.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ MicrosoftRTTIProcessor::MicrosoftRTTIProcessor(const Ref<BinaryView> &view, bool
639639

640640
void MicrosoftRTTIProcessor::ProcessRTTI()
641641
{
642-
auto bgTask = new BackgroundTask("Scanning for Microsoft RTTI...", true);
642+
Ref<BackgroundTask> bgTask = new BackgroundTask("Scanning for Microsoft RTTI...", true);
643643
auto start_time = std::chrono::high_resolution_clock::now();
644644
uint64_t startAddr = m_view->GetOriginalImageBase();
645645
uint64_t endAddr = m_view->GetEnd();
@@ -714,7 +714,7 @@ void MicrosoftRTTIProcessor::ProcessRTTI()
714714

715715
void MicrosoftRTTIProcessor::ProcessVFT()
716716
{
717-
auto bgTask = new BackgroundTask("Scanning for Microsoft VFT...", true);
717+
Ref<BackgroundTask> bgTask = new BackgroundTask("Scanning for Microsoft VFT...", true);
718718
std::map<uint64_t, uint64_t> vftMap = {};
719719
std::unordered_set<uint64_t> vftFinished = {};
720720
auto start_time = std::chrono::high_resolution_clock::now();

0 commit comments

Comments
 (0)