diff options
author | Vladimir Popov <vladimir.popov@xored.com> | 2021-09-27 11:21:20 +0700 |
---|---|---|
committer | Vladimir Popov <vladimir.popov@xored.com> | 2021-09-27 04:44:11 +0000 |
commit | 385ccc0d8ba929f39881efb7784bfb0921044ae8 (patch) | |
tree | ed8ac5ffba3426a993d6d2bbf5d1e3fcbac016b7 | |
parent | a5739cb7160349f96c428995049ff61411689ea0 (diff) |
core: close Stream after Connection.Invoke
Fixes core.Stream leaking on every core.(*Connection).Invoke()
https://lists.fd.io/g/govpp-dev/topic/govpp_is_leaking_channels_on/85836420
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Change-Id: I8d5bcb3c3aa40ccda3fb249ee80bb82809f284b1
-rw-r--r-- | core/stream.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/stream.go b/core/stream.go index 363cc9f..2f639b0 100644 --- a/core/stream.go +++ b/core/stream.go @@ -70,6 +70,7 @@ func (c *Connection) Invoke(ctx context.Context, req api.Message, reply api.Mess if err != nil { return err } + defer func() { _ = stream.Close() }() if err := stream.SendMsg(req); err != nil { return err } |