Skip to content

Commit fdb762b

Browse files
Ensure Call is closed when call exits.
1 parent 543061e commit fdb762b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/async/container/supervisor/connection.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ def self.call(connection, timeout: nil, **message, &block)
213213
end
214214
end
215215
ensure
216+
# Ensure the call is removed from the connection's calls hash, otherwise it will leak:
216217
connection.calls.delete(id)
218+
219+
# Ensure the call is closed, so that `Call#pop` will return `nil`.
220+
call.close
217221
end
218222
end
219223
end

0 commit comments

Comments
 (0)