diff options
author | stuconnolly <stuart02@gmail.com> | 2012-03-18 20:05:36 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-03-18 20:05:36 +0000 |
commit | 524e8c356b4074f5be5933b0551374a130a8f6d1 (patch) | |
tree | 0dab40735f2d9484930050cd08376cbf15e4ea55 /Source/SPNotLoaded.m | |
parent | be3263f8158cb6f3dfa1005f49beefa7e494b852 (diff) | |
download | sequelpro-524e8c356b4074f5be5933b0551374a130a8f6d1.tar.gz sequelpro-524e8c356b4074f5be5933b0551374a130a8f6d1.tar.bz2 sequelpro-524e8c356b4074f5be5933b0551374a130a8f6d1.zip |
Bring outline view branch up to date with trunk (r3471:r3517).
Diffstat (limited to 'Source/SPNotLoaded.m')
-rw-r--r-- | Source/SPNotLoaded.m | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/Source/SPNotLoaded.m b/Source/SPNotLoaded.m index 49e6cbfa..3938823f 100644 --- a/Source/SPNotLoaded.m +++ b/Source/SPNotLoaded.m @@ -30,7 +30,7 @@ static SPNotLoaded *notLoaded = nil; @implementation SPNotLoaded // Return the singleton object -+ (SPNotLoaded *) notLoaded ++ (SPNotLoaded *)notLoaded { @synchronized(self) { if (notLoaded == nil) { @@ -40,16 +40,19 @@ static SPNotLoaded *notLoaded = nil; return notLoaded; } -+ (id) allocWithZone:(NSZone *)zone ++ (id)allocWithZone:(NSZone *)zone { @synchronized(self) { return [[self notLoaded] retain]; } + + return nil; } -- (id) init +- (id)init { Class notLoadedClass = [self class]; + @synchronized(notLoadedClass) { if (notLoaded == nil) { if ((self = [super init])) { @@ -57,18 +60,19 @@ static SPNotLoaded *notLoaded = nil; } } } + return notLoaded; } -- (id) copyWithZone:(NSZone *)zone { return self; } +- (id)copyWithZone:(NSZone *)zone { return self; } -- (id) retain { return self; } +- (id)retain { return self; } -- (NSUInteger) retainCount { return NSUIntegerMax; } +- (NSUInteger)retainCount { return NSUIntegerMax; } -- (oneway void) release {} +- (oneway void)release {} -- (id) autorelease { return self; } +- (id)autorelease { return self; } @end @@ -78,11 +82,13 @@ static SPNotLoaded *notLoaded = nil; */ @implementation NSObject (SPNotLoadedTest) -- (BOOL) isSPNotLoaded +- (BOOL)isSPNotLoaded { static id SPNotLoadedForComparison; + if (!SPNotLoadedForComparison) SPNotLoadedForComparison = [SPNotLoaded notLoaded]; - return (self == SPNotLoadedForComparison); + + return (self == SPNotLoadedForComparison); } @end |