Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MusicHandler中 AVURLAsset 造成 内存泄漏 #15

Open
ucoker opened this issue Feb 5, 2016 · 0 comments
Open

MusicHandler中 AVURLAsset 造成 内存泄漏 #15

ucoker opened this issue Feb 5, 2016 · 0 comments

Comments

@ucoker
Copy link

ucoker commented Feb 5, 2016

你好,你的播放器写得很好。
我在测试的时候发现一个问题:

在 ESTMusicPlayer/Enesco/Handlers/MusicHandler.m 40行代码处:
AVURLAsset *audioAsset = [AVURLAsset URLAssetWithURL:[NSURL URLWithString:music.musicUrl] options:nil];

这句,造成,内存没法释放。

测试方法:

  • 在MusicHandler.m 40行后添加return,只测试这句。
AVURLAsset *audioAsset = [AVURLAsset URLAssetWithURL:[NSURL URLWithString:music.musicUrl] options:nil];
return;
  • 在MusicViewController.m 中的 - (void)createStreamer
    将原来 这句
    [MusicHandler configNowPlayingInfoCenter];

修改成

for (int i = 0; i < 1000; i++) {
        [MusicHandler configNowPlayingInfoCenter];
    }

发现内存泄露了。
Google很久,没发现解决的办法,请教下!

泄漏图:
qq20160205-0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant