AVAudioPlayerオブジェクトにメモリの問題がありますか?シミュレータでAVAudioPlayerを使用しているときにメモリリークが発生しています。私はAVAudioPlayerをどのように作成したかは関係ありません。私はinitWithContentsOfURL
とInitWithData
を使用しました。以下はコードのスニペットです。デバイス上でそれをテストする際のGithub https://github.com/docchang/MemoryLeakAVAudioPlayerAudioToolboxライブラリのメモリリークAVAudioPlayer
NSError *error;
NSURL *playerURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Bell" ofType:@"m4a"]];
self.playerWithURL = [[AVAudioPlayer alloc] initWithContentsOfURL:playerURL error:&error];
if (!playerWithURL) {
NSLog(@"no %@.%@: %@",@"Introduction2", @"m4a", [error localizedDescription]);
}
playerWithURL.volume = 0.9f;
playerWithURL.numberOfLoops = 0;
[playerWithURL play];
@全プロジェクトは、しかし、何のメモリリークはありません。この問題は、AudioToolBoxライブラリの問題に傾き始めていますが、単にstackoverflowの人々と確認したいのです。