pitrou commented on code in PR #46711:
URL: https://github.com/apache/arrow/pull/46711#discussion_r2140693270


##########
cpp/src/arrow/util/async_util.cc:
##########
@@ -350,8 +346,9 @@ class ThrottledAsyncTaskSchedulerImpl
          self = shared_from_this()]() mutable -> Result<Future<>> {
           ARROW_ASSIGN_OR_RAISE(Future<> inner_fut, (*inner_task)());
           if (!inner_fut.TryAddCallback([&] {
-                return [latched_cost, self = std::move(self)](const Status& 
st) -> void {
-                  if (st.ok()) {
+                return [latched_cost,
+                        weak_self = self->weak_from_this()](const Status& st) 
-> void {

Review Comment:
   Potential reference cycles through captured shared_ptr in async closures, 
yes. Not sure this is a problem currently, but it could certainly become one.



-- 
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]

Reply via email to