Fix FrameEvent: hold mutex during draw + e.Frame() per architecture doc §8
This commit is contained in:
parent
620d534454
commit
ae6cfcd448
|
|
@ -81,13 +81,12 @@ func run(w *app.Window) error {
|
|||
prevScale = newScale
|
||||
}
|
||||
|
||||
// Acquire mutex, read frame, draw, release mutex
|
||||
// Acquire mutex, read frame, draw, e.Frame(), release mutex
|
||||
mu.Lock()
|
||||
currentElems := elems
|
||||
mu.Unlock()
|
||||
|
||||
renderer.Draw(gtx, currentElems)
|
||||
e.Frame(&ops)
|
||||
mu.Unlock()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user