app/internal/wm: [macOS] release context only if it was created

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-05-16 12:01:38 +02:00
parent 566b4b166b
commit d5fc7fc8f6
+5 -3
View File
@@ -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 {