mapleFU opened a new issue, #39920:
URL: https://github.com/apache/arrow/issues/39920
### Describe the enhancement requested
```c++
diff --git a/cpp/src/arrow/dataset/scanner.cc
b/cpp/src/arrow/dataset/scanner.cc
index 18981d145..87e1b2c92 100644
--- a/cpp/src/arrow/dataset/scanner.cc
+++ b/cpp/src/arrow/dataset/scanner.cc
@@ -466,7 +466,7 @@ Result<EnumeratedRecordBatchGenerator>
AsyncScanner::ScanBatchesUnorderedAsync(
std::shared_ptr<void> stop_producing{
nullptr, [plan, exec_context](...) {
bool not_finished_yet = plan->finished().TryAddCallback(
- [&plan, &exec_context] { return [plan, exec_context](const
Status&) {}; });
+ [plan, exec_context] { return [plan, exec_context](const
Status&) {}; });
if (not_finished_yet) {
plan->StopProducing();
```
I found the code above, would using `&plan` `&exec_context`. Would this hit
lifetime problem? Or `plan->StopProducing()` would be safe here?
### Component(s)
C++
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]