Skip to content

Commit 0e954cb

Browse files
committed
BookMacster 1.17 working good, now making a few changes to better support changes to Safari in Mavericks. This commit contains fixes of memory leaks - woohoo BookMacster seems to be leak-free now, at least when performing all of the common operations. Also this commit has changes to quiet warnings which are new in Xcode 5 after “upgrading project to recommended settings”. One new warning that came up in 150 places is that Xcode 5 wants all selector name referenced in an @selector() directive to be declared in the file or included headers. Indeed, I have created unimplemented selector bugs in the past which would have been caught by this warning. So I spent a few hours adding a lot of #imports and declarations.
1 parent 0fa9e74 commit 0e954cb

18 files changed

+199
-188
lines changed

SSMoveableToolTip.m

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ - (id) init {
6060
}
6161

6262
- (void) dealloc {
63-
[_window release];
64-
[_textAttributes release];
63+
[_window release] ;
64+
[_textAttributes release] ;
65+
[_textField release] ; // Memory leak fixed in BookMacster 1.17
6566

6667
[super dealloc];
6768
}

SSRSS.m

+6-2
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,10 @@ - (void) normalizeRSSItem: (NSMutableDictionary *) rssItem {
522522
title = @"Untitled";
523523
} /*if*/
524524

525-
[rssItem setObject: title forKey: titleKey];
525+
if (title != nil) {
526+
527+
[rssItem setObject: title forKey: titleKey];
528+
} /*if*/
526529

527530
/*dangerousmeta case: super-long title with no description*/
528531

@@ -578,7 +581,8 @@ - (void) normalizeRSSItem: (NSMutableDictionary *) rssItem {
578581
if ([NSString stringIsEmpty: convertedTitle])
579582
convertedTitle = @"Untitled";
580583

581-
[rssItem setObject: convertedTitle forKey: @"convertedTitle"];
584+
if (convertedTitle != nil)
585+
[rssItem setObject: convertedTitle forKey: @"convertedTitle"];
582586
} /*if*/
583587
} /*if*/
584588
} /*deal with entities*/

SSYDocChildObject.m

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ - (id)initWithDocument:(BkmxDoc*)document_ {
3737
[self setDocument:document_] ;
3838
}
3939

40-
/*SSYDBL*/ NSLog(@"Initted %@", self) ;
4140
return self;
4241
}
4342

SSYDocFileObserver.m

+4-2
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,11 @@ - (oneway void)release {
112112
// when retainCount==2.
113113
if (([self retainCount] == 2) && m_retainedByTimer) {
114114
//
115-
m_retainedByTimer = NO ;
115+
m_retainedByTimer = NO ;
116+
// The following line has a bug fixed in BookMacster 1.17. Prior to
117+
// that, @selector(analyzePathChange:) was lacking the colon!
116118
[NSObject cancelPreviousPerformRequestsWithTarget:self
117-
selector:@selector(analyzePathChange)
119+
selector:@selector(analyzePathChange:)
118120
object:nil] ;
119121
// But we don't invoke -dealloc directly. The above cancellation
120122
// will send us a -release (since the timer retains us) which

SSYDragTableView.m

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#import "SSYDragTableView.h"
22
#import "NSInvocation+Quick.h"
3+
#import "SSYArrayController.h"
34

45

56
@implementation SSYDragTableView

SSYDynamicMenu.h

+2
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,6 @@
177177
*/
178178
- (void)reload ;
179179

180+
- (IBAction)hierarchicalMenuAction:(id)sender ;
181+
180182
@end

SSYHierarchicalTabViewItem.h

-28
This file was deleted.

SSYHierarchicalTabViewItem.m

-64
This file was deleted.

SSYHintArrow.m

-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
NSString* const SSYHintArrowDidCloseNotification = @"SSYHintArrowDidCloseNotification" ;
66

7-
NSString* const SSYHintArrowWillProcessEventNotification = @"SSYHintArrowWillProcessEventNotification" ;
87
NSString* const SSYHintArrowEventKey = @"SSYHintArrowEventKey" ;
98

109
#define SSYHINTARROW_TOP_COLOR [NSColor colorWithCalibratedRed:(80.0/256.0) green:(111.0/256.0) blue:(246.0/256.0) alpha:1.0]
@@ -189,11 +188,6 @@ - (SSYHintArrow *)initAttachedToPoint:(NSPoint)point
189188
name:NSWindowWillCloseNotification
190189
object:window] ;
191190

192-
[[NSNotificationCenter defaultCenter] addObserver:self
193-
selector:@selector(didReceiveEvent:)
194-
name:SSYHintArrowWillProcessEventNotification
195-
object:window] ;
196-
197191
// Configure window
198192
[super setBackgroundColor:[NSColor clearColor]] ;
199193
[self setMovableByWindowBackground:NO] ;

SSYHintableWindow.m

-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ - (void)sendEvent:(NSEvent *)event {
99
[super sendEvent:event] ;
1010
}
1111

12-
1312
@end

SSYInterappClient.m

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ + (BOOL)sendHeaderByte:(char)txHeaderByte
8585
}
8686
}
8787
}
88+
89+
[aggrRxData release] ;
8890

8991
end:
9092
if (!ok && error_p) {

SSYKeychain.m

+9-6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ + (NSArray*)searchKeychainFor:(SecKeychainSearchRef)searchRef
2828
getAttributes:(SecKeychainAttributeInfo)attributeInfo {
2929
NSArray *output= nil ;
3030
NSMutableArray* results = [[NSMutableArray alloc] init] ;
31+
// Unbelieveable bug fixed in BookMacster 1.17. How could this have been
32+
// so wrong for so long? Prior to this, returnArrayOfDics was determined
33+
// by the count of attributeList instead of attributeInfo.
34+
BOOL returnArrayOfDics = (attributeInfo.count > 1) ;
3135
OSStatus status = noErr ;
3236
while (status == noErr) {
3337
SecKeychainItemRef itemRef = NULL ;
@@ -50,7 +54,7 @@ + (NSArray*)searchKeychainFor:(SecKeychainSearchRef)searchRef
5054
NULL) ;
5155
if (attrResult == noErr) {
5256
NSMutableDictionary* itemDic = nil ;
53-
if (attributeList->count > 1) {
57+
if (returnArrayOfDics) {
5458
itemDic = [[NSMutableDictionary alloc] init] ;
5559
}
5660

@@ -65,7 +69,7 @@ + (NSArray*)searchKeychainFor:(SecKeychainSearchRef)searchRef
6569
attribute->length,
6670
kCFStringEncodingUTF8,
6771
false) ;
68-
if (attributeList->count > 1) {
72+
if (returnArrayOfDics) {
6973
[itemDic setObject:value
7074
forKey:[NSNumber numberWithInteger:(attribute->tag)]] ;
7175
}
@@ -76,7 +80,7 @@ + (NSArray*)searchKeychainFor:(SecKeychainSearchRef)searchRef
7680
}
7781
SecKeychainItemFreeAttributesAndData(attributeList, NULL) ;
7882

79-
if (attributeList->count > 1) {
83+
if (returnArrayOfDics) {
8084
[results addObject:[NSDictionary dictionaryWithDictionary:itemDic]] ;
8185
}
8286

@@ -87,8 +91,7 @@ + (NSArray*)searchKeychainFor:(SecKeychainSearchRef)searchRef
8791

8892
output = [[results copy] autorelease] ;
8993
[results release] ;
90-
91-
return output;
94+
return output ;
9295
}
9396

9497
+ (NSArray*)allGenericItems {
@@ -205,7 +208,7 @@ + (NSArray*)internetAccountsForHost:(NSString*)host {
205208

206209
output = [self searchKeychainFor:searchRef
207210
getAttributes:attributeInfo] ;
208-
}
211+
}
209212

210213
if (searchRef) {
211214
CFRelease(searchRef) ;

SSYLazyView.h

+26-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
#import <Cocoa/Cocoa.h>
22

3+
extern NSString* SSYLazyViewErrorDomain ;
4+
5+
#define SSY_LAZY_VIEW_ERROR_CODE_COULD_NOT_LOAD_NIB 992611
6+
#define SSY_LAZY_VIEW_ERROR_CODE_LEGACY_COULD_NOT_LOAD_NIB 992613
7+
#define SSY_LAZY_VIEW_ERROR_CODE_LEGACY_COULD_NOT_FIND_NIB 992614
8+
#define SSY_LAZY_VIEW_ERROR_CODE_NO_PAYLOAD 992616
9+
310
/*
4-
@brief Notification which is posted when the payload view loads.
11+
@brief Notification which is posted when the payload view is about to be
12+
loaded.
513
614
@details The notification object is the window in which the SSYLazyView object
7-
resides. Note that the
8-
loading of the payload, and hence the posting of this notification, occurs no
9-
more than once during the lifetime of an SSYLazyView object.
15+
resides. Note that the loading of the payload, and hence the posting of this
16+
notification, occurs no more than once during the lifetime of an SSYLazyView
17+
object.
18+
*/
19+
extern NSString* SSYLazyViewWillLoadPayloadNotification;
20+
21+
/*
22+
@brief Notification which is posted after the payload view loads.
23+
24+
@details Ditto from SSYLazyViewWillLoadPayloadNotification.
1025
*/
1126
extern NSString* SSYLazyViewDidLoadPayloadNotification;
1227

@@ -39,6 +54,13 @@ extern NSString* SSYLazyViewDidLoadPayloadNotification;
3954
in your Lazy View. For example, you may place a text field with large
4055
font size that says "Loading Stuff…". All of these placeholder subviews
4156
will be removed when the new view is placed in.
57+
58+
If an error occurs when attempting to load the payload, in either case (when
59+
receiver is moved to a window or upon -loadWithOwner:), an error dialog
60+
suggesting that the user reinstall the application is displayed. We did this
61+
because these errors should occur very rarely, and in the first case, there
62+
is no message for us to return an error in. Yeah, we could have used a
63+
delegate or something, but it's not worth the effort.
4264
*/
4365
@interface SSYLazyView : NSView {
4466
BOOL m_isPayloaded ;

0 commit comments

Comments
 (0)