mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: make [live] fn unlock its mutex on early return
This commit is contained in:

committed by
Alexander Medvednikov

parent
26374971ab
commit
4838dda59a
@ -56,6 +56,9 @@ fn main() {
|
||||
println('Starting the game loop...')
|
||||
go game.run()
|
||||
for {
|
||||
if window.should_close() {
|
||||
break
|
||||
}
|
||||
gl.clear()
|
||||
gl.clear_color(255, 255, 255, 255)
|
||||
game.draw()
|
||||
@ -101,5 +104,3 @@ fn (game mut Game) run() {
|
||||
time.sleep_ms(17)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,7 +30,10 @@ fn main() {
|
||||
})
|
||||
}
|
||||
go update() // update the scene in the background in case the window isn't focused
|
||||
for {
|
||||
for {
|
||||
if ctx.gg.window.should_close() {
|
||||
break
|
||||
}
|
||||
gg.clear(gx.White)
|
||||
ctx.draw()
|
||||
ctx.gg.render()
|
||||
|
Reference in New Issue
Block a user