File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2176,6 +2176,12 @@ - (id)init {
2176
2176
styleMask: NSTitledWindowMask
2177
2177
backing: NSBackingStoreBuffered
2178
2178
defer: NO ] ;
2179
+ /* NSWindow has nonstandard memory management. Note that, under non-ARC,
2180
+ we do *not* release this alloc-initted 'window', and the static analyzer
2181
+ does not complain about this! If we do [window release], then the static
2182
+ analyzer does not complain either (!!), but we get a runtime crash when
2183
+ this window is autoreleased! Read comments in my project NSWindowLifer,
2184
+ or maybe I will blog about this. */
2179
2185
NSString * appName = [[NSBundle mainAppBundle ] objectForInfoDictionaryKey: @" CFBundleName" ] ; // CFBundleName may be localized
2180
2186
if (appName) {
2181
2187
[window setTitle: appName] ;
@@ -2187,9 +2193,6 @@ - (id)init {
2187
2193
2188
2194
// Invoke designated initializer for super, NSWindowController
2189
2195
self = [super initWithWindow: window] ;
2190
- #if !__has_feature(objc_arc)
2191
- [window release ] ;
2192
- #endif
2193
2196
2194
2197
if (self) {
2195
2198
[self stealObjectsFromAppleAlerts ] ;
You can’t perform that action at this time.
0 commit comments