mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
app: lock explicitly before refreshing contexts
Signed-off-by: Joe Julian <me@joejulian.name>
This commit is contained in:
+6
-6
@@ -149,6 +149,12 @@ func (w *Window) validateAndProcess(size image.Point, sync bool, frame *op.Ops,
|
||||
sync = true
|
||||
}
|
||||
}
|
||||
if w.ctx != nil {
|
||||
if err := w.ctx.Lock(); err != nil {
|
||||
w.destroyGPU()
|
||||
return err
|
||||
}
|
||||
}
|
||||
if sync && w.ctx != nil {
|
||||
if err := w.ctx.Refresh(); err != nil {
|
||||
if errors.Is(err, errOutOfDate) {
|
||||
@@ -163,12 +169,6 @@ func (w *Window) validateAndProcess(size image.Point, sync bool, frame *op.Ops,
|
||||
return err
|
||||
}
|
||||
}
|
||||
if w.ctx != nil {
|
||||
if err := w.ctx.Lock(); err != nil {
|
||||
w.destroyGPU()
|
||||
return err
|
||||
}
|
||||
}
|
||||
if w.gpu == nil && !w.nocontext {
|
||||
gpu, err := gpu.New(w.ctx.API())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user