fix m_FinishedRequests not being cleared on Abort()
This commit is contained in:
@@ -206,7 +206,7 @@ bool BackgroundLoader::IsCacheFileFinished( const CString &sFile, CString &sActu
|
||||
return true;
|
||||
}
|
||||
|
||||
void BackgroundLoader::FinishedWithCachedFile( const CString &sFile )
|
||||
void BackgroundLoader::FinishedWithCachedFile( CString sFile )
|
||||
{
|
||||
if( !g_bEnableBackgroundLoading )
|
||||
return;
|
||||
@@ -238,6 +238,10 @@ void BackgroundLoader::Abort()
|
||||
while( !GetRequest().empty() )
|
||||
;
|
||||
|
||||
/* Clear any previously finished requests. */
|
||||
while( m_FinishedRequests.size() )
|
||||
FinishedWithCachedFile( m_FinishedRequests.begin()->first );
|
||||
|
||||
/* Tell the thread to abort any request it's handling now. */
|
||||
if( m_sThreadIsActive )
|
||||
m_sThreadShouldAbort = true;
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
bool IsCacheFileFinished( const CString &sFile, CString &sActualPath );
|
||||
|
||||
/* Call this when finished with a cached file, to release any resources. */
|
||||
void FinishedWithCachedFile( const CString &sFile );
|
||||
void FinishedWithCachedFile( CString sFile );
|
||||
|
||||
/* Abort all loads. */
|
||||
void Abort();
|
||||
|
||||
Reference in New Issue
Block a user