Partially fix thread safety issues around _cur_palette

Replaces: 4c59dfb6
See also: https://github.com/OpenTTD/OpenTTD/issues/8712
This commit is contained in:
Jonathan G Rennison
2021-04-05 20:25:45 +01:00
parent b496a0c442
commit e094b7f1d6
3 changed files with 18 additions and 2 deletions

View File

@@ -174,7 +174,12 @@ void VideoDriver::Tick()
this->PopulateSystemSprites();
}
this->CheckPaletteAnim();
{
extern std::mutex _cur_palette_mutex;
std::lock_guard<std::mutex> lock_state(_cur_palette_mutex);
this->CheckPaletteAnim();
}
this->Paint();
this->UnlockVideoBuffer();