app,app/internal/wm: release OpenGL context after use

Otherwise, making a context current on another thread may result in
an EGL_BAD_ACCESS error.

Fixes gio#248

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-07-26 21:35:19 +02:00
parent 152a30f468
commit 7da315eb2b
6 changed files with 14 additions and 0 deletions
+2
View File
@@ -117,6 +117,8 @@ func (c *d3d11Context) MakeCurrent() error {
return nil
}
func (c *d3d11Context) ReleaseCurrent() {}
func (c *d3d11Context) Lock() {}
func (c *d3d11Context) Unlock() {}
+4
View File
@@ -139,6 +139,10 @@ func (c *context) MakeCurrent() error {
return nil
}
func (c *context) ReleaseCurrent() {
C.gio_makeCurrent(0)
}
func (w *window) NewContext() (Context, error) {
return newContext(w)
}
+2
View File
@@ -62,6 +62,8 @@ func (c *context) MakeCurrent() error {
return nil
}
func (c *context) ReleaseCurrent() {}
func (w *window) NewContext() (Context, error) {
return newContext(w)
}
+4
View File
@@ -90,6 +90,10 @@ func (c *context) MakeCurrent() error {
return nil
}
func (c *context) ReleaseCurrent() {
C.gio_clearCurrentContext()
}
func (w *window) NewContext() (Context, error) {
return newContext(w)
}
+1
View File
@@ -70,6 +70,7 @@ type Context interface {
API() gpu.API
Present() error
MakeCurrent() error
ReleaseCurrent()
Refresh() error
Release()
Lock()