From 253fd4ad2d8095cc3c640c99d75ab3fd1cb7282e Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 12 Oct 2025 22:48:41 -0400 Subject: [WARP] Fix misc sidebar navigation / focus event bugs - Fixed crash related to pending fetch callback for deleted view frame - Fixed focus not being kept for tables in the sidebar, as well as focus in general - Made matched function list navigation require a double click, to fix accidental navigation to other functions --- plugins/warp/ui/plugin.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'plugins/warp/ui/plugin.cpp') diff --git a/plugins/warp/ui/plugin.cpp b/plugins/warp/ui/plugin.cpp index e8088d7c..f3c1639b 100644 --- a/plugins/warp/ui/plugin.cpp +++ b/plugins/warp/ui/plugin.cpp @@ -174,23 +174,22 @@ WarpSidebarWidget::WarpSidebarWidget(BinaryViewRef data) : SidebarWidget("WARP") // Do a full update if analysis has been done, otherwise we may persist old data and not have new data. m_analysisEvent = new AnalysisCompletionEvent(m_data, [this]() { ExecuteOnMainThread([this]() { Update(); }); }); - const std::shared_ptr fetcher = WarpFetcher::Global(); - fetcher->AddCompletionCallback([this]() { - Update(); + m_fetcher = WarpFetcher::Global(); + m_callbackId = m_fetcher->AddCompletionCallback([this]() { + ExecuteOnMainThread([this]() { Update(); }); return KeepCallback; }); // NOTE: This fetcher is shared with the fetch dialog that is constructed on initialization of this plugin. - m_currentFunctionWidget->SetFetcher(fetcher); + m_currentFunctionWidget->SetFetcher(m_fetcher); } WarpSidebarWidget::~WarpSidebarWidget() { m_analysisEvent->Cancel(); + m_fetcher->RemoveCompletionCallback(m_callbackId); } -void WarpSidebarWidget::focus() {} - void WarpSidebarWidget::Update() { m_currentFunctionWidget->UpdateMatches(); -- cgit v1.3.1