Skip to content

Commit

Permalink
Fix leaking debugger binary view after using the debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
xusheng6 authored and plafosse committed Sep 12, 2023
1 parent 2368d3c commit 089b147
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ui/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1095,14 +1095,15 @@ void DebuggerUI::updateUI(const DebuggerEvent& event)
}

FileContext* fileContext = frame->getFileContext();
fileContext->refreshDataViewCache();
auto tab = m_context->getTabForFile(fileContext);
ViewFrame* newFrame = m_context->openFileContext(fileContext);
QCoreApplication::processEvents();

if (newFrame)
{
newFrame->navigate(m_controller->GetData(), m_controller->GetData()->GetEntryPoint(), true, true);
m_context->closeTab(m_context->getTabForFile(fileContext));
m_context->closeTab(tab);
fileContext->refreshDataViewCache();
openDebuggerSideBar(newFrame);
QCoreApplication::processEvents();
}
Expand Down Expand Up @@ -1139,11 +1140,12 @@ 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(m_context->getTabForFile(fileContext));
m_context->closeTab(tab);
navigateToCurrentIP();
QCoreApplication::processEvents();
}
Expand Down

0 comments on commit 089b147

Please sign in to comment.