diff options
author | stuconnolly <stuart02@gmail.com> | 2010-03-16 13:22:06 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-03-16 13:22:06 +0000 |
commit | 392c1e5c5579b1b58e02acddf2880097d9e1e0ce (patch) | |
tree | 34c6a679d610802bf570272fdc3cb04fd2053970 /Source/SPQueryController.m | |
parent | 332f6201ce607a6622fadfd3e6426e4571dc035f (diff) | |
download | sequelpro-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/SPQueryController.m')
-rw-r--r-- | Source/SPQueryController.m | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index fec04630..b7fd77c3 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -62,7 +62,7 @@ static SPQueryController *sharedQueryController = nil; { @synchronized(self) { if (sharedQueryController == nil) { - [[self alloc] init]; + sharedQueryController = [[super allocWithZone:NULL] init]; } } @@ -72,14 +72,8 @@ static SPQueryController *sharedQueryController = nil; + (id)allocWithZone:(NSZone *)zone { @synchronized(self) { - if (sharedQueryController == nil) { - sharedQueryController = [super allocWithZone:zone]; - - return sharedQueryController; - } + return [[self sharedQueryController] retain]; } - - return nil; // On subsequent allocation attempts return nil } - (id)init |