Skip to content

Commit

Permalink
transition: fix minor data race
Browse files Browse the repository at this point in the history
  • Loading branch information
gucio321 committed Feb 18, 2023
1 parent 7c7e596 commit c30b47d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ func (t *TransitionAnimation) Init() {
func (t *TransitionAnimation) BuildNormal(starter StarterFunc) {
state := t.getState()

if state.layout == 0 {
state.m.Lock()
layout := state.layout
state.m.Unlock()

if layout == 0 {
t.renderer1(func() { starter(PlayAuto) })
} else {
t.renderer2(func() { starter(PlayAuto) })
Expand Down

0 comments on commit c30b47d

Please sign in to comment.