You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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。
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];
}
The text was updated successfully, but these errors were encountered: