app: [macOS] correct error handling for newMtlContext

Fixes: https://todo.sr.ht/~eliasnaur/gio/632
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2025-02-10 13:59:32 +01:00
parent 95354d80bd
commit af446e8b87
+1 -1
View File
@@ -96,7 +96,7 @@ func newMtlContext(w *window) (*mtlContext, error) {
return nil, errors.New("metal: CAMetalLayer construction failed")
}
queue := C.newCommandQueue(dev)
if layer == 0 {
if queue == 0 {
C.CFRelease(dev)
C.CFRelease(layer)
return nil, errors.New("metal: [MTLDevice newCommandQueue] failed")