Skip to content

Commit 0056327

Browse files
committed
• Fixed a few memory leaks and other new warnings issued by static analyzer after updating to Xcode 8.
1 parent ac1d6e3 commit 0056327

9 files changed

+25
-21
lines changed

SSYAlert.m

+2
Original file line numberDiff line numberDiff line change
@@ -2502,12 +2502,14 @@ - (void)dealloc {
25022502
[progressBar release] ;
25032503
[titleTextView release] ;
25042504
[smallTextView release] ;
2505+
[smallTextScrollView release] ;
25052506
[helpButton release] ;
25062507
[supportButton release] ;
25072508
[checkbox release] ;
25082509
[button1 release] ;
25092510
[button2 release] ;
25102511
[button3 release] ;
2512+
[button4 release] ;
25112513
[helpAnchorString release] ;
25122514
[errorPresenting release] ;
25132515
[iconInformational release] ;

SSYDeallocDetector.h

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
@details We leave the usage of this class to your imagination!
99
*/
1010
@interface SSYDeallocDetector : NSObject {
11-
NSInvocation* m_invocation ;
1211
}
1312

1413
@property (retain) NSInvocation* invocation ;

SSYDeallocDetector.m

+6-9
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
@implementation SSYDeallocDetector
55

6-
@synthesize invocation = m_invocation ;
7-
@synthesize logMsg = m_logMsg ;
8-
96
#if 0
107
#warning Logging R&R of Dealloc Detector
118
- (id)retain {
@@ -20,13 +17,13 @@ - (oneway void)release {
2017
#endif
2118

2219
- (void)dealloc {
23-
[[self invocation] invoke] ;
24-
[m_invocation release] ;
20+
[_invocation invoke] ;
2521

26-
if (m_logMsg) {
27-
NSLog(@"Deallocced %p %@", (__bridge void*)self, m_logMsg) ;
22+
[_invocation release] ;
23+
if (_logMsg) {
24+
NSLog(@"Deallocced %p %@", (__bridge void*)self, _logMsg) ;
2825
}
29-
[m_logMsg release] ;
26+
[_logMsg release] ;
3027

3128
[super dealloc] ;
3229
}
@@ -52,4 +49,4 @@ + (SSYDeallocDetector*)detectorWithInvocation:(NSInvocation*)invocation
5249
return [instance autorelease] ;
5350
}
5451

55-
@end
52+
@end

SSYHintArrow.m

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ @implementation SSYHintArrow
1717
# pragma mark * Heavy Lifters
1818

1919
- (CGFloat)scaleFactor {
20-
// Was using deprecated [NSScreen mainScreen] userSpaceScaleFactor]
21-
CGFloat factor = [[self contentView] backingScaleFactor] ;
20+
CGFloat factor = 1.0 ;
2221
return factor ;
2322
}
2423

@@ -349,4 +348,4 @@ + (void)removeIfEvent:(NSEvent*)event {
349348
}
350349
}
351350

352-
@end
351+
@end

SSYLabelledList.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ - (NSString *)tableView:(NSTableView*)tableView
271271
mouseLocation:(NSPoint)mouseLocation {
272272
id toolTip = [[self toolTips] objectAtIndex:rowIndex] ;
273273
if (![toolTip isKindOfClass:[NSString class]]) {
274-
toolTip = nil ;
274+
toolTip = @"" ;
275275
}
276276

277277
return toolTip ;

SSYLabelledRadioButtons.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ - (id)initWithLabel:(NSString*)label
215215
// If used, the label text field is added last.
216216
// We assume this order when accessing the subviews later.
217217

218-
NSButtonCell* cell = [[NSButtonCell alloc] initTextCell:@"proto"] ;
218+
NSButtonCell* cell = [[NSButtonCell alloc] initTextCell:NSLocalizedString(@"proto", nil)] ;
219219
[cell setButtonType:NSRadioButton] ;
220220
[cell setTitle:@""] ;
221221
NSMatrix* matrix = [[NSMatrix alloc] initWithFrame:NSZeroRect
@@ -329,4 +329,4 @@ - (id)initWithCoder:(NSCoder *)coder {
329329
return self ;
330330
}
331331

332-
@end
332+
@end

SSYLinearFileWriter.m

+6
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,11 @@ + (void)close {
7070
[[SSYLinearFileWriter sharedFileWriter] setFileHandle:nil] ;
7171
}
7272

73+
- (void)dealloc {
74+
[m_fileHandle release] ;
75+
76+
[super dealloc] ;
77+
}
78+
7379
@end
7480

SSYPrefsWindowController.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ -(void) dealloc {
3939

4040

4141
-(void) awakeFromNib {
42-
NSString* key;
4342
NSInteger index = 0;
4443
NSString* wndTitle = nil;
4544

46-
[[self window] setTitle:[self localizeString:@"windowTitlePrefs"]] ;
45+
NSString* title = NSLocalizedString(@"Preferences", nil) ;
46+
[[self window] setTitle:title] ;
4747

4848
// Generate a string containing the window's title so we can display the original window title plus the selected pane:
4949
wndTitle = [[ibOutlet_tabView window] title];
@@ -55,7 +55,7 @@ -(void) awakeFromNib {
5555
[[self window] setFrameAutosaveName:@"PrefsWindow"] ;
5656

5757
// Select the preferences page the user last had selected when this window was opened:
58-
key = [NSString stringWithFormat: @"%@.prefspanel.recentTab", @"PrefsWindow"];
58+
NSString* key = [NSString stringWithFormat: @"%@.prefspanel.recentTab", @"PrefsWindow"];
5959
index = [[NSUserDefaults standardUserDefaults] integerForKey:key];
6060
[ibOutlet_tabView selectTabViewItemAtIndex:index];
6161

@@ -325,4 +325,4 @@ - (NSString*)localizeString:(NSString*)key {
325325
}
326326

327327

328-
@end
328+
@end

SSYStarRatingView.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ -(void)dealloc
8585
[m_starHighlightedImage release] ;
8686
[m_removeXImage release] ;
8787
[m_backgroundColor release] ;
88+
[m_rating release] ;
8889

8990
[super dealloc] ;
9091
}
@@ -276,4 +277,4 @@ -(void)mouseUp:(NSEvent *)theEvent
276277
[[self delegate] starsSelectionChanged:self rating:[[self rating] floatValue]];
277278
}
278279

279-
@end
280+
@end

0 commit comments

Comments
 (0)