Skip to content

Commit 6ab0d3d

Browse files
committed
[WARP] Fix race condition with sidebar deletion with analysis completion event callback
1 parent ea8b4c8 commit 6ab0d3d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

plugins/warp/ui/plugin.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <QToolBar>
1111
#include <QVBoxLayout>
12+
#include <QtCore/QMetaObject>
1213
#include <utility>
1314

1415
using namespace BinaryNinja;
@@ -170,11 +171,13 @@ WarpSidebarWidget::WarpSidebarWidget(BinaryViewRef data) : SidebarWidget("WARP")
170171
this->setLayout(layout);
171172

172173
// Do a full update if analysis has been done, otherwise we may persist old data and not have new data.
173-
m_analysisEvent = new AnalysisCompletionEvent(m_data, [this]() { ExecuteOnMainThread([this]() { Update(); }); });
174+
m_analysisEvent = new AnalysisCompletionEvent(m_data, [this]() {
175+
QMetaObject::invokeMethod(this, [this]() { Update(); });
176+
});
174177

175178
m_fetcher = WarpFetcher::Global();
176179
m_callbackId = m_fetcher->AddCompletionCallback([this]() {
177-
ExecuteOnMainThread([this]() {
180+
QMetaObject::invokeMethod(this, [this]() {
178181
// Instead of doing a full update after fetching, we only want to make sure the current function has
179182
// up-to-date matches, since the other two tabs (all matches, container list) do not get populated with
180183
// additional information or manage their own updates (e.g. container source list).

0 commit comments

Comments
 (0)