We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04eedc6 commit cb4af5aCopy full SHA for cb4af5a
1 file changed
cpp/src/arrow/util/async_util.cc
@@ -202,6 +202,7 @@ class AsyncTaskSchedulerImpl : public AsyncTaskScheduler {
202
return;
203
}
204
// Capture `task` to keep it alive until finished
205
+ auto task_ptr = task.get();
206
if (!submit_result->TryAddCallback([this, task_inner = std::move(task)]() mutable {
207
return [this, task_inner2 = std::move(task_inner)](const Status& st) mutable {
208
#ifdef ARROW_WITH_OPENTELEMETRY
@@ -217,7 +218,7 @@ class AsyncTaskSchedulerImpl : public AsyncTaskScheduler {
217
218
})) {
219
return OnTaskFinished(submit_result->status());
220
} else {
- running_tasks_set_.insert(task.get());
221
+ running_tasks_set_.insert(task_ptr);
222
223
224
0 commit comments