Skip to content

Commit

Permalink
fix: vcsim: avoid race in DestroyPropertyFilter
Browse files Browse the repository at this point in the history
Need to lock the filter's PropertyCollector when removing reference to self.
  • Loading branch information
dougm committed Oct 25, 2024
1 parent 6df5289 commit fe93450
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion simulator/property_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ func (_ *PropertyFilter) RemoveObject(_ *Context, _ types.ManagedObjectReference
func (f *PropertyFilter) DestroyPropertyFilter(ctx *Context, c *types.DestroyPropertyFilter) soap.HasFault {
body := &methods.DestroyPropertyFilterBody{}

RemoveReference(&f.pc.Filter, c.This)
ctx.WithLock(f.pc, func() {
RemoveReference(&f.pc.Filter, c.This)
})

ctx.Session.Remove(ctx, c.This)

Expand Down

0 comments on commit fe93450

Please sign in to comment.