Skip to content

Commit 1c3a544

Browse files
committed
hold a tracker token in the detached updater IO task so shutdown waits for it
1 parent f98fabf commit 1c3a544

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

nextclient/launcher/src/updater_gui_app/NextUpdater/NextUpdaterHttpService.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ result<HttpResponse> NextUpdaterHttpService::PostAsync(
5050

5151
co_await InitializeBackendAddressIfNeeded(linked_ct);
5252

53+
// The IO task holds its own token: WithCancellation below can return before PostInternal finishes.
54+
std::shared_ptr<TaskTracker::Token> io_token = std::make_shared<TaskTracker::Token>(task_tracker_.MakeToken());
55+
5356
result<HttpResponse> internal_task = TaskCoro::RunIO(
54-
[this, method, data, linked_ct]() mutable
57+
[this, method, data, linked_ct, io_token]() mutable
5558
{
5659
return PostInternal(method, data, linked_ct);
5760
}

0 commit comments

Comments
 (0)