From d160719f1694ef39c804dd3f635f08edea8b10fa Mon Sep 17 00:00:00 2001 From: George Wright Date: Thu, 13 Jan 2022 14:29:43 -0800 Subject: [PATCH] Don't retain the MTLTexture or MTLDevice in TestMetalContext (flutter/engine#30832) --- engine/src/flutter/testing/test_metal_context.mm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/testing/test_metal_context.mm b/engine/src/flutter/testing/test_metal_context.mm index d2ea2cb3d1b..6ac70a2ae25 100644 --- a/engine/src/flutter/testing/test_metal_context.mm +++ b/engine/src/flutter/testing/test_metal_context.mm @@ -14,7 +14,7 @@ namespace flutter { TestMetalContext::TestMetalContext() { - auto device = fml::scoped_nsprotocol{[MTLCreateSystemDefaultDevice() retain]}; + auto device = fml::scoped_nsprotocol{MTLCreateSystemDefaultDevice()}; if (!device) { FML_LOG(ERROR) << "Could not acquire Metal device."; return; @@ -82,8 +82,7 @@ TestMetalContext::TextureInfo TestMetalContext::CreateMetalTexture(const SkISize } id device = (__bridge id)GetMetalDevice(); - sk_cfp texture = - sk_cfp{[[device newTextureWithDescriptor:texture_descriptor.get()] retain]}; + sk_cfp texture = sk_cfp{[device newTextureWithDescriptor:texture_descriptor.get()]}; if (!texture) { FML_CHECK(false) << "Could not create texture from texture descriptor.";