Skip to content

Commit

Permalink
Merge pull request #93 from mislav/stop-data-race
Browse files Browse the repository at this point in the history
Fix data race with struct access after calling `Stop()`
  • Loading branch information
briandowns committed Jul 4, 2020
2 parents 32574ea + 506d399 commit 274d177
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spinner.go
Expand Up @@ -285,10 +285,11 @@ func (s *Spinner) Start() {
case <-s.stopChan:
return
default:
s.mu.Lock()
if !s.active {
s.mu.Unlock()
return
}
s.mu.Lock()
s.erase()

if s.PreUpdate != nil {
Expand Down

0 comments on commit 274d177

Please sign in to comment.