Skip to content

Commit e61afb1

Browse files
committed
fix: vcsim: Avoid possible race in SessionManager.Logout
Signed-off-by: Doug MacEachern <dougm@broadcom.com>
1 parent 0cbdbf0 commit e61afb1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

simulator/session_manager.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ func (s *SessionManager) Logout(ctx *Context, _ *types.Logout) soap.HasFault {
196196
s.delSession(session.Key)
197197
pc := ctx.Map.content().PropertyCollector
198198

199+
ctx.Session.Registry.m.Lock()
200+
defer ctx.Session.Registry.m.Unlock()
201+
199202
for ref, obj := range ctx.Session.Registry.objects {
200203
if ref == pc {
201204
continue // don't unregister the PropertyCollector singleton

0 commit comments

Comments
 (0)