Misc leaks fixes.

CQTexperiment
vspader 2009-09-01 21:14:07 -07:00
parent 50326dfed8
commit 288c5cbee5
11 changed files with 25 additions and 17 deletions

View File

@ -266,6 +266,7 @@
{
if (nextStream == nil)
{
[newChain release];
return YES;
}

View File

@ -137,7 +137,7 @@ addressForHost(NSString *hostname)
}
buffer[bytesRead] = '\0';
result = [[[NSString alloc] autorelease] initWithUTF8String:buffer];
result = [[[NSString alloc] initWithUTF8String:buffer] autorelease];
} while(keepGoing);

View File

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

View File

@ -72,7 +72,7 @@ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMA
- (NSString *) ellipsizeAfterNWords: (int) n {
NSArray *stringComponents = [self componentsSeparatedByString: @" "];
NSMutableArray *componentsCopy = [stringComponents mutableCopy];
NSMutableArray *componentsCopy = [[stringComponents mutableCopy] autorelease];
int ix = n;
int len = [componentsCopy count];

View File

@ -110,8 +110,11 @@ int ao_get_lib(char *fn, uint8 **buf, uint64 *length)
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"];
@ -335,6 +338,7 @@ int ao_get_lib(char *fn, uint8 **buf, uint64 *length)
AODecoder *decoder = [[self alloc] init];
if (![decoder openUnderLock:source]) {
[decoder release];
[globalLock unlock];
return nil;
}

View File

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

View File

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

View File

@ -26,6 +26,7 @@
// 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.

View File

@ -61,16 +61,16 @@ static NSPredicate * musicOnlyPredicate = nil;
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];

View File

@ -33,7 +33,7 @@
// 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];
}

View File

@ -52,8 +52,8 @@ static NSString *TrackingSliderValueObservationContext = @"TrackingSliderValueOb
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];
}