使用MPMoviePlayerViewController iOS 4.2时,AudioToolbox的iPhone内存泄漏 [英] iPhone Memory Leak from AudioToolbox when using MPMoviePlayerViewController iOS 4.2
问题描述
我正在使用以下代码(在标签栏应用程序中的视图控制器内)播放用户选择表格行后从主包中加载的视频。
I'm using the following code (inside a view controller in a tab bar application) to play video loaded from the main bundle after a user selects a table row.
- (void)loadMoviePlayer:(NSString*)moviePath
{
NSURL* fileURL = [[NSURL alloc] initFileURLWithPath:moviePath];
MPMoviePlayerViewController* player = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
[fileURL release];
[self presentMoviePlayerViewControllerAnimated:player];
[player release];
}
该应用程序在模拟器中构建并运行时没有任何明显问题(我没有'尚未在设备上测试过)但是当我通过仪器运行时,在视频播放过程中会发生内存泄漏。
Instruments强调AudioToolbox为'Responsible Library'和 SimAggregateDevice :: SimAggregateDevice(_CFString const *,_CFString const *,long&)
和
The app builds and runs without any obvious problems in the simulator (I haven't tested on a device yet) but when I run it through Instruments a memory leak occurs during video playback.
Instruments highlights the AudioToolbox as the 'Responsible Library' and SimAggregateDevice::SimAggregateDevice(_CFString const*, _CFString const*, long&)
and
APComponent::CreateDispatchTable(AudioComponentPluginInterface*, unsigned long)
作为'负责任的框架'。
as the 'Responsible Frame(s)'.
您可以获得的任何亮点都将非常感谢!
谢谢。
Any light you can shed on this would be much appreciated! Thanks.
推荐答案
问题不在于模拟器本身,而是而是为Mac OS X编译的AVFoundation
框架。 - Alex Nichol 2011年8月17日23:53
The problem isn't the "simulator" itself, but rather the AVFoundation framework compiled for Mac OS X. – Alex Nichol Aug 17 '11 at 23:53
我'我将此评论由Alex设为接受的答案。 K
I'm setting this comment by Alex as the accepted answer. K
这篇关于使用MPMoviePlayerViewController iOS 4.2时,AudioToolbox的iPhone内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!