I need to call the following method several time to play music from a particular view controller.
Each time I call this method memory increases. Those memory are not released when I leave that view controller. If I remove the listenFeebackUpdates block code, it working fine without any unwanted memory issues.
To reproduce the issue I attached following code snippets, please check it.
(void)playMusicWithFileName:(NSString*)fileName{
AFSoundItem *item = [[AFSoundItem alloc] initWithLocalResource:fileName atPath:nil];
[player pause];
player = nil;
player = [[AFSoundPlayback alloc] initWithItem:item];
item = nil;
// If I remove the listenFeedbackUpdate code block then there is no memory issue.
[player listenFeedbackUpdatesWithBlock:nil andFinishedBlock:^(void) {
NSLog(@"Finished");
}];
I need to call the following method several time to play music from a particular view controller. Each time I call this method memory increases. Those memory are not released when I leave that view controller. If I remove the listenFeebackUpdates block code, it working fine without any unwanted memory issues.
To reproduce the issue I attached following code snippets, please check it.
(void)playMusicWithFileName:(NSString*)fileName{
AFSoundItem *item = [[AFSoundItem alloc] initWithLocalResource:fileName atPath:nil]; [player pause]; player = nil; player = [[AFSoundPlayback alloc] initWithItem:item]; item = nil;
// If I remove the listenFeedbackUpdate code block then there is no memory issue. [player listenFeedbackUpdatesWithBlock:nil andFinishedBlock:^(void) { NSLog(@"Finished"); }];
[player play]; }
Thanks