From a214f0e2f812182b99163dc06918ec1d33826c12 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Wed, 21 Feb 2024 20:36:55 +0800 Subject: [PATCH] Fix memory leak on the binary view if the input view is rebased during launch --- core/processview.cpp | 2 +- ui/ui.cpp | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/core/processview.cpp b/core/processview.cpp index 147d285..2a4ded1 100644 --- a/core/processview.cpp +++ b/core/processview.cpp @@ -192,7 +192,7 @@ void DebugProcessView::eventHandler(const DebuggerEvent &event) DebugNullView::DebugNullView(BinaryView* parent) : - BinaryView("Debugger Null", parent->GetFile(), parent) + BinaryView("Debugger Null", parent->GetFile(), nullptr) { } diff --git a/ui/ui.cpp b/ui/ui.cpp index 7386cf7..276c223 100644 --- a/ui/ui.cpp +++ b/ui/ui.cpp @@ -1190,15 +1190,9 @@ void DebuggerUI::updateUI(const DebuggerEvent& event) ViewFrame* frame = m_context->getCurrentViewFrame(); FileContext* fileContext = frame->getFileContext(); fileContext->refreshDataViewCache(); - auto tab = m_context->getTabForFile(fileContext); - ViewFrame* newFrame = m_context->openFileContext(fileContext); - - if (newFrame) - { - m_context->closeTab(tab); - navigateToCurrentIP(); - QCoreApplication::processEvents(); - } + m_context->recreateViewFrames(fileContext); + navigateToCurrentIP(); + QCoreApplication::processEvents(); } else {