mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-05 11:59:41 +01:00
Codefix: Null video driver: take the game lock
The game loop must run with the game lock held.
This commit is contained in:
parent
abdea49d24
commit
bac9bf93bc
@ -51,7 +51,10 @@ void VideoDriver_Null::MainLoop()
|
|||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
for (i = 0; i < this->ticks && ! _exit_game; i++) {
|
for (i = 0; i < this->ticks && ! _exit_game; i++) {
|
||||||
::GameLoop();
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(this->game_state_mutex);
|
||||||
|
::GameLoop();
|
||||||
|
}
|
||||||
::InputLoop();
|
::InputLoop();
|
||||||
::UpdateWindows();
|
::UpdateWindows();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user