From 780813d9b6bfc58aa45571c367071c3a44fb2b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 25 Jan 2023 22:38:25 +0100 Subject: [PATCH] rhi: Remove manual release of autoreleased NSString The [NSString stringWithUTF8String:] function returns an autoreleased object, so we don't need to manually release it. Doing so results in a crash when the surrounding autorelease pool is drained. Pick-to: 6.5 6.4 6.2 Change-Id: I3dca01e2771d4010e582c2bf770f3d2281343dc3 Reviewed-by: Andy Nichols --- src/gui/rhi/qrhimetal.mm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm index a2b90e99a80..cf9112fe548 100644 --- a/src/gui/rhi/qrhimetal.mm +++ b/src/gui/rhi/qrhimetal.mm @@ -4449,10 +4449,7 @@ id QRhiMetalData::createMetalLib(const QShader &shader, QShader::Var id QRhiMetalData::createMSLShaderFunction(id lib, const QByteArray &entryPoint) { - NSString *name = [NSString stringWithUTF8String: entryPoint.constData()]; - id f = [lib newFunctionWithName: name]; - [name release]; - return f; + return [lib newFunctionWithName:[NSString stringWithUTF8String:entryPoint.constData()]]; } void QMetalGraphicsPipeline::setupAttachmentsInMetalRenderPassDescriptor(void *metalRpDesc, QMetalRenderPassDescriptor *rpD)