Open a363211861 opened 11 years ago
I found dealloc method of audioPlayer never been called,In my project. I think the reason may be retain cycle on self
with blocks。 such as the code:
[fastApiQueue addOperationWithBlock:^
{
pthread_mutex_lock(&playerMutex);
{
.......
[self clearQueue];
.......
}
pthread_mutex_unlock(&playerMutex);
}];
In my viewController, call the playInfo: function many times in a short period of time,then pop the viewController(viewDidDisappear: is called),music is still playing。
-(void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated];
}
-(void)playInfo:(NSDictionary *)info { self.musicInfo = info;
NSURL *url = [self getPlayURL:info]; [_audioPlayer setDataSource:[_audioPlayer dataSourceFromURL:url] withQueueItemId:url]; }