From 70897c3e5e182838b34c84f7f5cd0a313c80bfb9 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 5 Apr 2021 21:30:14 +0100 Subject: [PATCH] Only call InteractiveRandom when game state mutex is held --- src/video/video_driver.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/video/video_driver.cpp b/src/video/video_driver.cpp index 178a42044c..55ad5ff689 100644 --- a/src/video/video_driver.cpp +++ b/src/video/video_driver.cpp @@ -136,10 +136,6 @@ void VideoDriver::Tick() /* Avoid next_draw_tick getting behind more and more if it cannot keep up. */ if (this->next_draw_tick < now - ALLOWED_DRIFT * this->GetDrawInterval()) this->next_draw_tick = now; - /* Keep the interactive randomizer a bit more random by requesting - * new values when-ever we can. */ - InteractiveRandom(); - this->InputLoop(); /* Check if the fast-forward button is still pressed. */ @@ -156,6 +152,10 @@ void VideoDriver::Tick() std::lock_guard lock_wait(this->game_thread_wait_mutex); std::lock_guard lock_state(this->game_state_mutex); + /* Keep the interactive randomizer a bit more random by requesting + * new values when-ever we can. */ + InteractiveRandom(); + this->LockVideoBuffer(); if (this->change_blitter != nullptr) {