mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-04 15:19:09 +00: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:
parent
0f29e36440
commit
0a9c764dc4
1 changed files with 6 additions and 8 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue