aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPGrowlController.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/SPGrowlController.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/SPGrowlController.m')
-rw-r--r--Source/SPGrowlController.m12
1 files changed, 3 insertions, 9 deletions
diff --git a/Source/SPGrowlController.m b/Source/SPGrowlController.m
index 0e41a258..13d06f3c 100644
--- a/Source/SPGrowlController.m
+++ b/Source/SPGrowlController.m
@@ -39,7 +39,7 @@ static SPGrowlController *sharedGrowlController = nil;
{
@synchronized(self) {
if (sharedGrowlController == nil) {
- [[self alloc] init];
+ sharedGrowlController = [[super allocWithZone:NULL] init];
}
}
@@ -49,14 +49,8 @@ static SPGrowlController *sharedGrowlController = nil;
+ (id)allocWithZone:(NSZone *)zone
{
@synchronized(self) {
- if (sharedGrowlController == nil) {
- sharedGrowlController = [super allocWithZone:zone];
-
- return sharedGrowlController;
- }
- }
-
- return nil; // On subsequent allocation attempts return nil
+ return [[self sharedGrowlController] retain];
+ }
}
- (id)init