diff --git a/src/backend/metal/DeviceMTL.mm b/src/backend/metal/DeviceMTL.mm index 368615cedd..98aa3c6c47 100644 --- a/src/backend/metal/DeviceMTL.mm +++ b/src/backend/metal/DeviceMTL.mm @@ -66,7 +66,8 @@ namespace backend { namespace metal { } Tick(); - mPendingCommands = nil; // This will be autoreleased. + [mPendingCommands release]; + mPendingCommands = nil; delete mMapTracker; mMapTracker = nullptr; @@ -155,6 +156,7 @@ namespace backend { namespace metal { id Device::GetPendingCommandBuffer() { if (mPendingCommands == nil) { mPendingCommands = [mCommandQueue commandBuffer]; + [mPendingCommands retain]; } return mPendingCommands; } @@ -174,7 +176,8 @@ namespace backend { namespace metal { }]; [mPendingCommands commit]; - mPendingCommands = nil; // This will be autoreleased. + [mPendingCommands release]; + mPendingCommands = nil; mPendingCommandSerial++; }