summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-01-25 22:38:25 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-01 13:46:11 +0000
commit8eee5acfb2fff49e3f0a713f406eedceea7449eb (patch)
tree10eb7dd37eefc9052ef670cdd9a76e6dab6fbfae
parent28c0af6dc33c9cb8d1a6f6ee48ecb474752eb239 (diff)
downloadqtbase-8eee5acfb2fff49e3f0a713f406eedceea7449eb.tar.gz
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. Change-Id: I3dca01e2771d4010e582c2bf770f3d2281343dc3 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 780813d9b6bfc58aa45571c367071c3a44fb2b44) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/gui/rhi/qrhimetal.mm5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm
index f2f374130e..70e5825a11 100644
--- a/src/gui/rhi/qrhimetal.mm
+++ b/src/gui/rhi/qrhimetal.mm
@@ -3724,10 +3724,7 @@ id<MTLLibrary> QRhiMetalData::createMetalLib(const QShader &shader, QShader::Var
id<MTLFunction> QRhiMetalData::createMSLShaderFunction(id<MTLLibrary> lib, const QByteArray &entryPoint)
{
- NSString *name = [NSString stringWithUTF8String: entryPoint.constData()];
- id<MTLFunction> f = [lib newFunctionWithName: name];
- [name release];
- return f;
+ return [lib newFunctionWithName:[NSString stringWithUTF8String:entryPoint.constData()]];
}
bool QMetalGraphicsPipeline::create()