Skip to content

Commit

Permalink
fix: data racing
Browse files Browse the repository at this point in the history
resolve #913
  • Loading branch information
ysmood committed Aug 1, 2023
1 parent 7fae9b3 commit 48e06d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ func (b *Browser) Sleeper(sleeper func() utils.Sleeper) *Browser {

// Context returns a clone with the specified ctx for chained sub-operations
func (p *Page) Context(ctx context.Context) *Page {
p.helpersLock.Lock()
newObj := *p
p.helpersLock.Unlock()
newObj.ctx = ctx
return &newObj
}
Expand Down

0 comments on commit 48e06d6

Please sign in to comment.