Skip to content

Commit cb4af5a

Browse files
author
Rafał Hibner
committed
Fix track running tasks2
1 parent 04eedc6 commit cb4af5a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cpp/src/arrow/util/async_util.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ class AsyncTaskSchedulerImpl : public AsyncTaskScheduler {
202202
return;
203203
}
204204
// Capture `task` to keep it alive until finished
205+
auto task_ptr = task.get();
205206
if (!submit_result->TryAddCallback([this, task_inner = std::move(task)]() mutable {
206207
return [this, task_inner2 = std::move(task_inner)](const Status& st) mutable {
207208
#ifdef ARROW_WITH_OPENTELEMETRY
@@ -217,7 +218,7 @@ class AsyncTaskSchedulerImpl : public AsyncTaskScheduler {
217218
})) {
218219
return OnTaskFinished(submit_result->status());
219220
} else {
220-
running_tasks_set_.insert(task.get());
221+
running_tasks_set_.insert(task_ptr);
221222
}
222223
}
223224

0 commit comments

Comments
 (0)