diff --git a/app/internal/wm/gl_macos.go b/app/internal/wm/gl_macos.go index 40d16e21..7c231ae1 100644 --- a/app/internal/wm/gl_macos.go +++ b/app/internal/wm/gl_macos.go @@ -58,9 +58,11 @@ func (c *context) API() gpu.API { } func (c *context) Release() { - C.gio_clearCurrentContext() - C.CFRelease(c.ctx) - c.ctx = 0 + if c.ctx != 0 { + C.gio_clearCurrentContext() + C.CFRelease(c.ctx) + c.ctx = 0 + } } func (c *context) Present() error {