Commits

Anonymous committed 5506853

Misc leaks fixes.

  • Participants
  • Parent commits 760c66a

Comments (0)

Files changed (11)

Audio/AudioPlayer.m

 		{
 			if (nextStream == nil)
 			{
+				[newChain release];
 				return YES;
 			}
 			

AudioScrobbler/AudioScrobblerClient.m

 		}
 
 		buffer[bytesRead]	= '\0';
-		result				= [[[NSString alloc] autorelease] initWithUTF8String:buffer];
+		result				= [[[NSString alloc] initWithUTF8String:buffer] autorelease];
 		
 	} while(keepGoing);
 	

FileTree/ContainerNode.m

 		ContainedNode *node = [[ContainedNode alloc] initWithDataSource:dataSource url:u];
 		NSLog(@"Node: %@", u);
 		[paths addObject:node];
+		[node release];
 	}	
 	
 	[self setSubpaths:paths];

Frameworks/Sparkle/NSString+extras.m

 - (NSString *) ellipsizeAfterNWords: (int) n {
 	
 	NSArray *stringComponents = [self componentsSeparatedByString: @" "];
-	NSMutableArray *componentsCopy = [stringComponents mutableCopy];
+	NSMutableArray *componentsCopy = [[stringComponents mutableCopy] autorelease];
 	int ix = n;
 	int len = [componentsCopy count];
 	

Plugins/AudioOverload/AODecoder.m

 			NSString *key = [[NSString alloc] initWithUTF8String:info.title[i]];
 			NSString *value = [[NSString alloc] initWithUTF8String:info.info[i]];
 			
-			if (nil == key || nil == value)
+			if (nil == key || nil == value) {
+				[key release];
+				[value release];
 				continue;
+			}
 			
 			if ([key hasPrefix:@"Name"]) {
 				[dict setObject:value forKey:@"title"];
 	
 	AODecoder *decoder = [[self alloc] init];
 	if (![decoder openUnderLock:source]) {
+		[decoder release];
 		[globalLock unlock];
 		return nil;
 	}

Plugins/HTTPSource/Utils/HTTPConnection.m

 	// Send it off!
 	NSInteger sent = [_socket send:requestBytes amount:requestLength];
 	if (sent != requestLength) {
+		[requestString release];
 		return NO;
 	}
 	NSLog(@"Sent:\n%@\n", requestString);

Preferences/General/GeneralPreferencesPlugin.m

 
 + (NSArray *)preferencePanes
 {
-	GeneralPreferencesPlugin *plugin = [[GeneralPreferencesPlugin alloc] init];
+	GeneralPreferencesPlugin *plugin = [[[GeneralPreferencesPlugin alloc] init] autorelease];
 	[NSBundle loadNibNamed:@"Preferences" owner:plugin];
 	
 	return [NSArray arrayWithObjects: 

Preferences/PreferencesController.m

 		
         // Set which panes are included, and their order.
         //[prefs setPanesOrder:[NSArray arrayWithObjects:@"General", @"Updating", @"A Non-Existent Preference Pane", nil]];
+		[pluginController release];
     }
     
     // Show the preferences window.

Spotlight/SpotlightWindowController.m

         self.query = [[[NSMetadataQuery alloc]init]autorelease];
         [self.query setDelegate:self];
         self.query.sortDescriptors = [NSArray arrayWithObjects:
-        [[NSSortDescriptor alloc]initWithKey:@"kMDItemAuthors"
-                                   ascending:YES
-                                    selector:@selector(compareFirstString:)],
-        [[NSSortDescriptor alloc]initWithKey:@"kMDItemAlbum"
-                                   ascending:YES
-                                    selector:@selector(caseInsensitiveCompare:)],
-        [[NSSortDescriptor alloc]initWithKey:@"kMDItemAudioTrackNumber"
-                                   ascending:YES
-                                    selector:@selector(compareTrackNumbers:)],
-        nil];
+									  [[[NSSortDescriptor alloc]initWithKey:@"kMDItemAuthors"
+																 ascending:YES
+																   selector:@selector(compareFirstString:)] autorelease],
+									  [[[NSSortDescriptor alloc]initWithKey:@"kMDItemAlbum"
+																 ascending:YES
+																  selector:@selector(caseInsensitiveCompare:)] autorelease],
+									  [[[NSSortDescriptor alloc]initWithKey:@"kMDItemAudioTrackNumber"
+																 ascending:YES
+																  selector:@selector(compareTrackNumbers:)] autorelease],
+									  nil];
         
         // hook my query transformer up to me
         [PausingQueryTransformer setSearchController:self];

ThirdParty/GCWindowMenu/GCOneShotEffectTimer.m

 	// unlike the usual case, this is returned retained (by self, effectively). The one-shot releases
 	// itself when it's complete
 	
-	return ft;
+	return [ft autorelease];
 }
 
 

Utils/TrackingSlider.m

 		
 		NSDictionary *bindingsData = [NSDictionary dictionaryWithObjectsAndKeys:
 									  observableController, NSObservedObjectKey,
-									  [keyPath copy], NSObservedKeyPathKey,
-									  [options copy], NSOptionsKey, nil];
+									  [[keyPath copy] autorelease], NSObservedKeyPathKey,
+									  [[options copy] autorelease], NSOptionsKey, nil];
 		
 		[bindingInfo setObject:bindingsData forKey:binding];
 	}