Revert "app: release GPU before processing DestroyEvent"

This reverts commit 8620b43eb3.

Releasing the GPU after ack'ing the DestroyEvent is too late.

Updates gio#67
This commit is contained in:
Elias Naur
2019-11-12 22:12:57 +01:00
parent 2e0406802b
commit 41abb5b08d
+2 -6
View File
@@ -218,12 +218,6 @@ func (w *Window) run(opts *window.Options) {
w.out <- system.DestroyEvent{Err: err}
return
}
defer func() {
if w.gpu != nil {
w.gpu.Release()
w.gpu = nil
}
}()
for {
var timer <-chan time.Time
if w.delayedDraw != nil {
@@ -303,6 +297,8 @@ func (w *Window) run(opts *window.Options) {
}
if e2.Sync {
if err := w.gpu.Flush(); err != nil {
w.gpu.Release()
w.gpu = nil
w.destroy(err)
return
}