File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
cocos/renderer/backend/metal Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ class CommandBufferMTL final : public CommandBuffer
195
195
196
196
dispatch_semaphore_t _frameBoundarySemaphore;
197
197
RenderPassDescriptor _prevRenderPassDescriptor;
198
+ NSAutoreleasePool* _autoReleasePool = nil;
198
199
};
199
200
200
201
// end of _metal group
Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ MTLCullMode toMTLCullMode(CullMode mode)
220
220
221
221
void CommandBufferMTL::beginFrame ()
222
222
{
223
+ _autoReleasePool = [[NSAutoreleasePool alloc ] init ];
223
224
dispatch_semaphore_wait (_frameBoundarySemaphore, DISPATCH_TIME_FOREVER);
224
225
225
226
_mtlCommandBuffer = [_mtlCommandQueue commandBuffer ];
@@ -366,6 +367,7 @@ MTLCullMode toMTLCullMode(CullMode mode)
366
367
[_mtlCommandBuffer commit ];
367
368
[_mtlCommandBuffer release ];
368
369
DeviceMTL::resetCurrentDrawable ();
370
+ [_autoReleasePool drain ];
369
371
}
370
372
371
373
void CommandBufferMTL::afterDraw ()
You can’t perform that action at this time.
0 commit comments