Fixed various memory leaks.
authorKent Sutherland <ksuther@ithinksw.com>
Mon, 19 Sep 2005 21:03:28 +0000 (21:03 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Mon, 19 Sep 2005 21:03:28 +0000 (21:03 +0000)
PlaylistNode.m
StatusWindowController.m
iTunesRemote.m

index 12ae00b..050912c 100644 (file)
@@ -27,7 +27,7 @@
                _name = [n retain];
                _type = t;
                _index = i;
-               _children = [[NSMutableArray alloc] init];
+               _children = nil;
                _parent = nil;
        }
        return self;
@@ -53,6 +53,9 @@
 
 - (NSMutableArray *)children
 {
+       if (!_children) {
+               _children = [[NSMutableArray alloc] init];
+       }
        return _children;
 }
 
index a3336a6..db04626 100755 (executable)
@@ -193,6 +193,7 @@ static StatusWindowController *sharedController;
     
     [_window buildTextWindowWithString:text];
     [_window appear:self];
+       [text release];
 }
 
 - (void)showUpcomingSongsWindowWithTitles:(NSArray *)titleStrings
index b5365b2..82b3b09 100755 (executable)
                                                newParent = test;
                                        }
                                }
+                               [[[nextNode parent] children] removeObject:nextNode];
                                [nextNode setParent:newParent];
                                [[newParent children] addObject:nextNode];
                                [newParent setType:ITMTFolderNode];
                NSEnumerator *nestEnumerator = [nested objectEnumerator];
                while ( (nextNode = [nestEnumerator nextObject]) ) {
                        [[sourceNode children] removeObject:nextNode];
+                       [nested removeObject:nextNode];
                }
                [nested release];
                
                enumerator = [[sourceNode children] reverseObjectEnumerator];
                while ( (nextNode = [enumerator nextObject]) ) {
                        if ([nextNode type] == ITMTPodcastsNode) {
-                               [nextNode retain];
                                [[sourceNode children] removeObject:nextNode];
                                [[sourceNode children] insertObject:nextNode atIndex:1];
                                movedPodcasts = YES;
                        } else if ([nextNode type] == ITMTFolderNode) {
-                               [nextNode retain];
                                [[sourceNode children] removeObject:nextNode];
                                [[sourceNode children] insertObject:nextNode atIndex:1 + movedPodcasts];
                        }
                 ITDebugLog(@"iTunes' highLPongOfPSN: %lu.", number.highLongOfPSN);
                 ITDebugLog(@"iTunes' lowLongOfPSN: %lu.", number.lowLongOfPSN);
                 ITDebugLog(@"Done getting iTunes' PSN.");
+                               [(NSString *)name release];
                 return number;
             }
             [(NSString *)name release];