Manually retain/release mPendingCommands (#208)
Fixes a crash for me on macOS+Metal
This commit is contained in:
parent
f53f98bf86
commit
66c06f42f4
|
@ -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<MTLCommandBuffer> 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++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue