We want to store printers as an ivar, so the array needs to be retained
authorRobert Sesek <rsesek@bluestatic.org>
Wed, 6 Aug 2008 18:07:06 +0000 (14:07 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Wed, 6 Aug 2008 18:07:06 +0000 (14:07 -0400)
* Source/AppController.m:
(init): Use [[NSA alloc] initWithContentsOfFile:] instead of [NSA arrayWith...]
(dealloc): New method

Source/AppController.m

index 000cb72d7c3b9b54d3b166b9a76a0f3598708805..9110144bf9146bdc0978678693a65d1077ca1080 100644 (file)
 {
        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
  */