summaryrefslogtreecommitdiff
path: root/plugins/warp/ui/plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/warp/ui/plugin.cpp')
-rw-r--r--plugins/warp/ui/plugin.cpp11
1 files changed, 5 insertions, 6 deletions
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<WarpFetcher> 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();