mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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:
@ -56,14 +56,7 @@ void HiresTexture::Init()
|
|||||||
|
|
||||||
void HiresTexture::Shutdown()
|
void HiresTexture::Shutdown()
|
||||||
{
|
{
|
||||||
if (s_prefetcher.joinable())
|
Clear();
|
||||||
{
|
|
||||||
s_textureCacheAbortLoading.Set();
|
|
||||||
s_prefetcher.join();
|
|
||||||
}
|
|
||||||
|
|
||||||
s_textureMap.clear();
|
|
||||||
s_textureCache.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HiresTexture::Update()
|
void HiresTexture::Update()
|
||||||
@ -147,6 +140,11 @@ void HiresTexture::Update()
|
|||||||
|
|
||||||
void HiresTexture::Clear()
|
void HiresTexture::Clear()
|
||||||
{
|
{
|
||||||
|
if (s_prefetcher.joinable())
|
||||||
|
{
|
||||||
|
s_textureCacheAbortLoading.Set();
|
||||||
|
s_prefetcher.join();
|
||||||
|
}
|
||||||
s_textureMap.clear();
|
s_textureMap.clear();
|
||||||
s_textureCache.clear();
|
s_textureCache.clear();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user