Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions view/kernelcache/ui/KernelCacheUINotifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,25 @@ void UINotifications::OnViewChange(UIContext* context, ViewFrame* frame, const Q
uint64_t addr = 0;
if (GetAddressInput(addr, "Address", "Address"))
{
BackgroundThread::create(ctx.context->mainWindow())
->thenBackground([ctx, addr]() {
loadImageAtAddr(*ctx.binaryView, addr);
auto view = ctx.binaryView;
if (!view)
return;
auto owner = ctx.context ? ctx.context->mainWindow() : nullptr;
BackgroundThread::create(owner)
->thenBackground([view, addr]() {
loadImageAtAddr(*view, addr);
})->start();
}
};

auto loadImageTokenAction = [](const UIActionContext& ctx) {
auto view = ctx.binaryView;
if (!view)
return;
uint64_t addr = TokenAddress(ctx);
BackgroundThread::create(ctx.context->mainWindow())
->thenBackground([ctx, addr](){ loadImageAtAddr(*ctx.binaryView, addr); })
auto owner = ctx.context ? ctx.context->mainWindow() : nullptr;
BackgroundThread::create(owner)
->thenBackground([view, addr](){ loadImageAtAddr(*view, addr); })
->start();
};

Expand Down
34 changes: 25 additions & 9 deletions view/sharedcache/ui/SharedCacheUINotifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ void UINotifications::OnViewChange(UIContext* context, ViewFrame* frame, const Q
uint64_t addr = 0;
if (GetAddressInput(addr, "Address", "Address"))
{
BackgroundThread::create(ctx.context->mainWindow())
->thenBackground([ctx, addr]() {
loadImageAtAddr(*ctx.binaryView, addr);
auto view = ctx.binaryView;
if (!view)
return;
auto owner = ctx.context ? ctx.context->mainWindow() : nullptr;
BackgroundThread::create(owner)
->thenBackground([view, addr]() {
loadImageAtAddr(*view, addr);
})->start();
}
};
Expand All @@ -140,23 +144,35 @@ void UINotifications::OnViewChange(UIContext* context, ViewFrame* frame, const Q
uint64_t addr = 0;
if (GetAddressInput(addr, "Address", "Address"))
{
BackgroundThread::create(ctx.context->mainWindow())
->thenBackground([ctx, addr](){ loadRegionAtAddr(*ctx.binaryView, addr); })
auto view = ctx.binaryView;
if (!view)
return;
auto owner = ctx.context ? ctx.context->mainWindow() : nullptr;
BackgroundThread::create(owner)
->thenBackground([view, addr](){ loadRegionAtAddr(*view, addr); })
->start();
}
};

auto loadRegionTokenAction = [](const UIActionContext& ctx) {
auto view = ctx.binaryView;
if (!view)
return;
uint64_t addr = TokenAddress(ctx);
BackgroundThread::create(ctx.context->mainWindow())
->thenBackground([ctx, addr](){ loadRegionAtAddr(*ctx.binaryView, addr); })
auto owner = ctx.context ? ctx.context->mainWindow() : nullptr;
BackgroundThread::create(owner)
->thenBackground([view, addr](){ loadRegionAtAddr(*view, addr); })
->start();
};

auto loadImageTokenAction = [](const UIActionContext& ctx) {
auto view = ctx.binaryView;
if (!view)
return;
uint64_t addr = TokenAddress(ctx);
BackgroundThread::create(ctx.context->mainWindow())
->thenBackground([ctx, addr](){ loadImageAtAddr(*ctx.binaryView, addr); })
auto owner = ctx.context ? ctx.context->mainWindow() : nullptr;
BackgroundThread::create(owner)
->thenBackground([view, addr](){ loadImageAtAddr(*view, addr); })
->start();
};

Expand Down