VideoCommon: Join the prefetch thread before clearing to avoid a potential crash that can occur by multiple threads touching a single resource
This commit is contained in:
parent
0f29e36440
commit
0a9c764dc4
|
@ -56,14 +56,7 @@ void HiresTexture::Init()
|
|||
|
||||
void HiresTexture::Shutdown()
|
||||
{
|
||||
if (s_prefetcher.joinable())
|
||||
{
|
||||
s_textureCacheAbortLoading.Set();
|
||||
s_prefetcher.join();
|
||||
}
|
||||
|
||||
s_textureMap.clear();
|
||||
s_textureCache.clear();
|
||||
Clear();
|
||||
}
|
||||
|
||||
void HiresTexture::Update()
|
||||
|
@ -147,6 +140,11 @@ void HiresTexture::Update()
|
|||
|
||||
void HiresTexture::Clear()
|
||||
{
|
||||
if (s_prefetcher.joinable())
|
||||
{
|
||||
s_textureCacheAbortLoading.Set();
|
||||
s_prefetcher.join();
|
||||
}
|
||||
s_textureMap.clear();
|
||||
s_textureCache.clear();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue