Fix leak of the Indexer when an audio/video file has already been indexed

Originally committed to SVN as r6940.
This commit is contained in:
Thomas Goyne 2012-07-23 00:44:47 +00:00
parent 11a4ede9a0
commit b2fb39b67f
2 changed files with 6 additions and 0 deletions

View file

@ -143,6 +143,9 @@ void FFmpegSourceAudioProvider::LoadAudio(wxString filename) {
if (TrackNumber == FFMS_TRACKMASK_ALL)
TrackNumber = FFMS_GetFirstTrackOfType(Index, FFMS_TYPE_AUDIO, &ErrInfo);
}
else {
FFMS_CancelIndexing(Indexer);
}
// update access time of index file so it won't get cleaned away
if (!wxFileName(CacheName).Touch()) {

View file

@ -132,6 +132,9 @@ void FFmpegSourceVideoProvider::LoadVideo(wxString filename) {
TrackMask = FFMS_TRACKMASK_ALL;
Index = DoIndexing(Indexer, CacheName, TrackMask, GetErrorHandlingMode());
}
else {
FFMS_CancelIndexing(Indexer);
}
// update access time of index file so it won't get cleaned away
wxFileName(CacheName).Touch();