From 11c876139892b7e7e30bb977ffb03a2292901ddf Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 6 Aug 2008 14:07:06 -0400 Subject: [PATCH] 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 --- Source/AppController.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 */ -- 2.43.5