Skip to content

Commit c9944c4

Browse files
committed
Do not read ivar in callback, unsafe
1 parent 3fd5f42 commit c9944c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/concurrent/actor/utils/pool.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def on_message(message)
4242
else
4343
Envelope.new(envelope.message, Concurrent.future, envelope.sender, envelope.sender)
4444
end
45-
envelope.future.on_completion! { @balancer << :subscribe }
45+
envelope.future.on_completion! &lambda { |balancer, success, value, reason| balancer << :subscribe }.curry[@balancer]
4646
redirect @balancer, envelope_to_redirect
4747
end
4848
end

0 commit comments

Comments
 (0)