From e09f3aa2865e87dda44ffc3d79b0d06da6a8f1e4 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 8 Nov 2020 04:44:31 +0900 Subject: [PATCH] graphicsdriver/metal/mtl: Bug fix: Fix the guard range --- internal/graphicsdriver/metal/mtl/mtl.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/graphicsdriver/metal/mtl/mtl.go b/internal/graphicsdriver/metal/mtl/mtl.go index 2569716e9..13e91f129 100644 --- a/internal/graphicsdriver/metal/mtl/mtl.go +++ b/internal/graphicsdriver/metal/mtl/mtl.go @@ -587,9 +587,8 @@ func (cb CommandBuffer) AddCompletedHandler(f func()) { //export commandBufferCompletedCallback func commandBufferCompletedCallback(commandBuffer unsafe.Pointer) { - f := commandBufferCompletedHandlers[commandBuffer] - commandBufferCompletedHandlersM.Lock() + f := commandBufferCompletedHandlers[commandBuffer] delete(commandBufferCompletedHandlers, commandBuffer) commandBufferCompletedHandlersM.Unlock()