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();
|
Tick();
|
||||||
|
|
||||||
mPendingCommands = nil; // This will be autoreleased.
|
[mPendingCommands release];
|
||||||
|
mPendingCommands = nil;
|
||||||
|
|
||||||
delete mMapTracker;
|
delete mMapTracker;
|
||||||
mMapTracker = nullptr;
|
mMapTracker = nullptr;
|
||||||
|
@ -155,6 +156,7 @@ namespace backend { namespace metal {
|
||||||
id<MTLCommandBuffer> Device::GetPendingCommandBuffer() {
|
id<MTLCommandBuffer> Device::GetPendingCommandBuffer() {
|
||||||
if (mPendingCommands == nil) {
|
if (mPendingCommands == nil) {
|
||||||
mPendingCommands = [mCommandQueue commandBuffer];
|
mPendingCommands = [mCommandQueue commandBuffer];
|
||||||
|
[mPendingCommands retain];
|
||||||
}
|
}
|
||||||
return mPendingCommands;
|
return mPendingCommands;
|
||||||
}
|
}
|
||||||
|
@ -174,7 +176,8 @@ namespace backend { namespace metal {
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[mPendingCommands commit];
|
[mPendingCommands commit];
|
||||||
mPendingCommands = nil; // This will be autoreleased.
|
[mPendingCommands release];
|
||||||
|
mPendingCommands = nil;
|
||||||
mPendingCommandSerial++;
|
mPendingCommandSerial++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue