From: Robert Sesek Date: Wed, 6 Aug 2008 18:07:06 +0000 (-0400) Subject: We want to store printers as an ivar, so the array needs to be retained X-Git-Tag: 1.1~9 X-Git-Url: https://src.bluestatic.org/?a=commitdiff_plain;h=11c876139892b7e7e30bb977ffb03a2292901ddf;p=printdrop.git We want to store printers as an ivar, so the array needs to be retained * Source/AppController.m: (init): Use [[NSA alloc] initWithContentsOfFile:] instead of [NSA arrayWith...] (dealloc): New method --- diff --git a/Source/AppController.m b/Source/AppController.m index 000cb72..9110144 100644 --- a/Source/AppController.m +++ b/Source/AppController.m @@ -39,12 +39,21 @@ { if (self = [super init]) { - printers = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Printers" ofType:@"plist"]]; + printers = [[NSArray alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Printers" ofType:@"plist"]]; [NSThread detachNewThreadSelector:@selector(versionCheck:) toTarget:self withObject:self]; } return self; } +/** + * Dealloc + */ +- (void)dealloc +{ + [printers release]; + [super dealloc]; +} + /** * Checks and sees if the current version is the most up-to-date one */