From af446e8b8756394626329a8b5a0decbc3642018b Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 10 Feb 2025 13:59:32 +0100 Subject: [PATCH] app: [macOS] correct error handling for newMtlContext Fixes: https://todo.sr.ht/~eliasnaur/gio/632 Signed-off-by: Elias Naur --- app/metal_darwin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/metal_darwin.go b/app/metal_darwin.go index 0043ffb3..fd3d6808 100644 --- a/app/metal_darwin.go +++ b/app/metal_darwin.go @@ -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")