Skip to content

Commit d0f2beb

Browse files
author
George Wright
authored
Don't retain the MTLTexture or MTLDevice in TestMetalContext (flutter#30832)
1 parent 742eaf8 commit d0f2beb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

testing/test_metal_context.mm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace flutter {
1515

1616
TestMetalContext::TestMetalContext() {
17-
auto device = fml::scoped_nsprotocol{[MTLCreateSystemDefaultDevice() retain]};
17+
auto device = fml::scoped_nsprotocol{MTLCreateSystemDefaultDevice()};
1818
if (!device) {
1919
FML_LOG(ERROR) << "Could not acquire Metal device.";
2020
return;
@@ -82,8 +82,7 @@
8282
}
8383

8484
id<MTLDevice> device = (__bridge id<MTLDevice>)GetMetalDevice();
85-
sk_cfp<void*> texture =
86-
sk_cfp<void*>{[[device newTextureWithDescriptor:texture_descriptor.get()] retain]};
85+
sk_cfp<void*> texture = sk_cfp<void*>{[device newTextureWithDescriptor:texture_descriptor.get()]};
8786

8887
if (!texture) {
8988
FML_CHECK(false) << "Could not create texture from texture descriptor.";

0 commit comments

Comments
 (0)