Add MLN_CREATE_AUTORELEASEPOOL flag to create autoreleasepool in render loop (#3655)

This commit is contained in:
Bart Louwers
2025-07-28 23:24:21 +02:00
committed by GitHub
parent 588562ef0d
commit 8e7c52b9b9
2 changed files with 23 additions and 1 deletions

View File

@@ -93,6 +93,10 @@ void Renderer::Impl::render(const RenderTree& renderTree, const std::shared_ptr<
assert(updateParameters);
#if MLN_RENDER_BACKEND_METAL
#if MLN_CREATE_AUTORELEASEPOOL
NS::SharedPtr pool = NS::TransferPtr(NS::AutoreleasePool::alloc()->init());
#endif
if constexpr (EnableMetalCapture) {
const auto& mtlBackend = static_cast<mtl::RendererBackend&>(backend);