Skip to content

Commit b38cd02

Browse files
committedApr 9, 2013
Lots of stuff
Sorry I don't keep a list when working on this code.
1 parent ded4264 commit b38cd02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1678
-572
lines changed
 

‎MAKVONotificationCenter.m

+9-3
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,17 @@ + (id)defaultCenter
140140
// if center is not nil, does nothing and returns false
141141
// This will happen if another thread snuck in and set it.
142142
// Mike's original line, does not work with garbage collection.
143-
// if(!OSAtomicCompareAndSwapPtrBarrier(nil, newCenter, (void *)&center)) {
143+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
144144
// See Brian Webster's first comment in http://www.mikeash.com/?page=pyblog/key-value-observing-done-right.html
145145
// Patched line:
146-
if(!objc_atomicCompareAndSwapGlobalBarrier(nil, newCenter, &center)) {
147-
// Thread race has occurred and we lost
146+
BOOL weWon = objc_atomicCompareAndSwapGlobalBarrier(nil, newCenter, &center) ;
147+
#else
148+
// Mike's original code, does not support Garbage Collection but works
149+
// in 10.5 and earlier
150+
BOOL weWon = OSAtomicCompareAndSwapPtrBarrier(nil, newCenter, (void *)&center) ;
151+
#endif
152+
if (!weWon) {
153+
// Thread race has occurred and we lost
148154
// center has previously been set to newCenter by another thread
149155
[newCenter release];
150156
}

‎SSRSS.m

+1-14
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,7 @@ - (SSRSS *) initWithData:(NSData *) rssData normalize:(BOOL)fl {
106106
encoding = documentInfo->encoding ;
107107
CFRelease (tree);
108108
}
109-
else {
110-
NSString* dataString = [[NSString alloc] initWithData:rssData encoding:NSASCIIStringEncoding] ;
111-
// We used ASCII because if the string is corrupt UTF8 may fail
112-
[dataString release] ;
113-
114-
NSString* filePath = [NSString stringWithFormat:
115-
@"%@/Desktop/GoogleBad.%@.%lx.data",
116-
NSHomeDirectory(),
117-
NSUserName(),
118-
(long)[[NSDate date] timeIntervalSinceReferenceDate]] ;
119-
NSString* msg = @"Could not parse data from Google containing some bookmarks.\n\n Some of your Google Bookmarks may be missing.\n\nFile containing bad data was written to your desktop." ;
120-
[rssData writeToFile:filePath atomically:NO] ;
121-
NSRunCriticalAlertPanel(nil, msg, nil, nil, nil) ;
122-
109+
else {
123110
// See http://lists.apple.com/archives/Objc-language/2008/Sep/msg00133.html ...
124111
[super dealloc] ;
125112
self = nil ;

0 commit comments

Comments
 (0)
Please sign in to comment.