Skip to content

Commit a36bab5

Browse files
MacOS App: do not manually release process arguments as they are autoreleased
Fix DiligentGraphics/DiligentSamples#228
1 parent 1716841 commit a36bab5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

NativeApp/Apple/Source/Classes/OSX/ViewBase.mm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright 2015-2019 Egor Yusov
1+
/* Copyright 2025 Diligent Graphics LLC
2+
* Copyright 2015-2019 Egor Yusov
23
*
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.
@@ -46,18 +47,17 @@ - (void) awakeFromNib
4647
std::vector<std::string> ArgStr;
4748
@autoreleasepool
4849
{
49-
NSArray<NSString*>* arguments = [[NSProcessInfo processInfo] arguments];
50+
NSArray<NSString*>* arguments = [[NSProcessInfo processInfo] arguments]; // Autoreleased
5051
const auto ArgCount = arguments.count;
5152
Args.resize(ArgCount);
5253
ArgStr.resize(ArgCount);
5354
for(size_t i = 0; i < ArgCount; ++i)
5455
{
55-
ArgStr[i] = [arguments[i] cStringUsingEncoding:NSUTF8StringEncoding];
56+
ArgStr[i] = [arguments[i] cStringUsingEncoding:NSUTF8StringEncoding]; // Autoreleased
5657
Args[i] = ArgStr[i].c_str();
5758
}
58-
[arguments release];
5959
}
60-
60+
6161
_theApp.reset(Diligent::CreateApplication());
6262
_theApp->ProcessCommandLine(static_cast<int>(Args.size()), Args.data());
6363

0 commit comments

Comments
 (0)