我消除了當前應用程序中的所有泄漏。然而,樂器不斷告訴我,我在下面顯示的方法有泄漏。試圖找到NSMutableArray類型的泄漏。儀器顯示方法泄漏。
泄漏類型爲NSMutableArray
,大小爲16或32字節。是的,我知道這並不多,但它增加了。也將它看作是我需要解決的一個學術問題,以使我的代碼無泄漏。
+ (id) meterFromDict:(NSDictionary*)dict {
Meter* resMeter = [[Meter alloc] initWithType:[[dict objectForKey:@"MeterBase"] intValue]];
//NSLog(@"dict: %@",dict);
resMeter.volume = nil;
resMeter.sounds = nil;
resMeter.repeats = nil;
resMeter.volume = [[[NSMutableArray alloc] initWithArray:[dict objectForKey:@"volumeArray"]] autorelease];
resMeter.sounds = [[[NSMutableArray alloc] initWithArray:[dict objectForKey:@"soundsArray"]] autorelease];
resMeter.repeats = [[[NSMutableArray alloc] initWithArray:[dict objectForKey:@"repeatsArray"]] autorelease];
//NSLog(@"MeterFromDict called and resmeter.repeats count is : %i",[resMeter.repeats count]);
resMeter.bpm = [[dict objectForKey:@"BPM"] floatValue];
return [resMeter autorelease];
}
代碼中沒有明顯的泄漏。它可能在米類中? – amattn
您可能想深入研究並查看'initWithType'實例方法。也許有泄漏 – basvk