aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPNotLoaded.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-03-16 13:22:06 +0000
committerstuconnolly <stuart02@gmail.com>2010-03-16 13:22:06 +0000
commit392c1e5c5579b1b58e02acddf2880097d9e1e0ce (patch)
tree34c6a679d610802bf570272fdc3cb04fd2053970 /Source/SPNotLoaded.m
parent332f6201ce607a6622fadfd3e6426e4571dc035f (diff)
downloadsequelpro-392c1e5c5579b1b58e02acddf2880097d9e1e0ce.tar.gz
sequelpro-392c1e5c5579b1b58e02acddf2880097d9e1e0ce.tar.bz2
sequelpro-392c1e5c5579b1b58e02acddf2880097d9e1e0ce.zip
Modify our current implementation of all singleton instances to be inline with Apple's recommendations detailed at http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW32 This also fixes the associated static analysis warnings of potentially leaked objects.
Diffstat (limited to 'Source/SPNotLoaded.m')
-rw-r--r--Source/SPNotLoaded.m7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/SPNotLoaded.m b/Source/SPNotLoaded.m
index e1e76806..6814e2e8 100644
--- a/Source/SPNotLoaded.m
+++ b/Source/SPNotLoaded.m
@@ -34,7 +34,7 @@ static SPNotLoaded *notLoaded = nil;
{
@synchronized(self) {
if (notLoaded == nil) {
- [[self alloc] init];
+ notLoaded = [[super allocWithZone:NULL] init];
}
}
return notLoaded;
@@ -43,11 +43,8 @@ static SPNotLoaded *notLoaded = nil;
+ (id) allocWithZone:(NSZone *)zone
{
@synchronized(self) {
- if (notLoaded == nil) {
- return [super allocWithZone:zone];
- }
+ return [[self notLoaded] retain];
}
- return notLoaded;
}
- (id) init