Skip to content

Commit bdb8f79

Browse files
committed
Do not call retain on Objective-C string literals
These literals are not freed from memory and do not need to be retained.
1 parent 67f742e commit bdb8f79

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Mac/PythonLauncher/FileSettings.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ - (id)initForFSDefaultFileType: (NSString *)filetype
119119
dict = [factorySettings objectForKey: filetype];
120120
if (dict == NULL) {
121121
NSLog(@"factorySettings.plist misses file type \"%@\"", filetype);
122-
interpreter = [@"no default found" retain];
122+
interpreter = @"no default found";
123123
return NULL;
124124
}
125125
[self applyValuesFromDict: dict];
@@ -134,7 +134,7 @@ - (id)initForFSDefaultFileType: (NSString *)filetype
134134
}
135135
}
136136
if (interpreter == NULL)
137-
interpreter = [@"no default found" retain];
137+
interpreter = @"no default found";
138138
origsource = NULL;
139139
return self;
140140
}
@@ -159,7 +159,7 @@ - (id)initForDefaultFileType: (NSString *)filetype
159159
self = [self initWithFileSettings: fsdefaults];
160160
if (!self) return self;
161161
interpreters = [fsdefaults->interpreters retain];
162-
scriptargs = [@"" retain];
162+
scriptargs = @"";
163163
[self applyUserDefaults: filetype];
164164
prefskey = [filetype retain];
165165
return self;

Mac/PythonLauncher/MyDocument.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ - (id)init
1919

2020
// Add your subclass-specific initialization here.
2121
// If an error occurs here, send a [self dealloc] message and return nil.
22-
script = [@"<no script>.py" retain];
23-
filetype = [@"Python Script" retain];
22+
script = @"<no script>.py";
23+
filetype = @"Python Script";
2424
settings = NULL;
2525
}
2626
return self;

0 commit comments

Comments
 (0)