mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
app/headless: avoid race between ReleaseCurrent and MakeCurrent
Release context on MakeCurrent failure paths as well. Fixes gio#144 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -139,8 +139,9 @@ func contextDo(ctx context, f func() error) error {
|
||||
errCh <- err
|
||||
return
|
||||
}
|
||||
defer ctx.ReleaseCurrent()
|
||||
errCh <- f()
|
||||
err := f()
|
||||
ctx.ReleaseCurrent()
|
||||
errCh <- err
|
||||
}()
|
||||
return <-errCh
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user