Fix CoreFoundationDataSource not releasing resources as early as possible

This commit is contained in:
Thong Nguyen 2013-03-22 11:40:00 +00:00
parent 8c6c74a820
commit c9efe47e9d
3 changed files with 12 additions and 0 deletions

View File

@ -1439,6 +1439,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
currentlyReadingEntry.dataSource.delegate = nil;
[currentlyReadingEntry.dataSource unregisterForEvents];
[currentlyReadingEntry.dataSource close];
if (currentlyPlayingEntry)
{
@ -1467,6 +1468,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
{
currentlyReadingEntry.dataSource.delegate = nil;
[currentlyReadingEntry.dataSource unregisterForEvents];
[currentlyReadingEntry.dataSource close];
if (currentlyPlayingEntry)
{

View File

@ -87,6 +87,16 @@ static void ReadStreamCallbackProc(CFReadStreamRef stream, CFStreamEventType eve
}
}
-(void) close
{
if (stream)
{
CFReadStreamClose(stream);
stream = 0;
}
}
-(void) seekToOffset:(long long)offset
{
}