Skip to content

Commit 5e9a6fe

Browse files
committed
Add lock to handle_button_press
We don't want to change UI elements while we are compiling.
1 parent 6325511 commit 5e9a6fe

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

rpcs3/Emu/RSX/Overlays/BigPicture/overlay_big_picture_game_grid.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ namespace rsx
161161

162162
void big_picture_game_grid::finish_reload(std::vector<std::unique_ptr<big_picture_game_tile>>&& tiles)
163163
{
164-
std::lock_guard lock(m_reload_mutex);
164+
std::lock_guard lock(m_mutex);
165165

166166
if (thread_ctrl::state() == thread_state::aborting)
167167
{
@@ -280,6 +280,8 @@ namespace rsx
280280

281281
page_navigation big_picture_game_grid::handle_button_press(pad_button button_press, bool is_auto_repeat, u64 auto_repeat_interval_ms)
282282
{
283+
std::lock_guard lock(m_mutex);
284+
283285
if (m_loading) return page_navigation::stay;
284286

285287
const bool do_play_sound = !is_auto_repeat || auto_repeat_interval_ms >= user_interface::m_auto_repeat_ms_interval_default;
@@ -384,7 +386,7 @@ namespace rsx
384386

385387
compiled_resource& big_picture_game_grid::get_compiled()
386388
{
387-
std::lock_guard lock(m_reload_mutex);
389+
std::lock_guard lock(m_mutex);
388390

389391
if (!m_highlight->is_compiled() ||
390392
(!m_tiles.empty() && m_grid && !m_grid->is_compiled()) ||

rpcs3/Emu/RSX/Overlays/BigPicture/overlay_big_picture_game_grid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace rsx
5252
static constexpr u16 m_columns = 5;
5353
static constexpr u16 m_tile_size = 200;
5454

55-
std::mutex m_reload_mutex;
55+
std::mutex m_mutex;
5656
std::unique_ptr<named_thread<std::function<void()>>> m_game_enumeration_thread;
5757

5858
game_enumeration<big_picture_game_info> m_game_enumeration;

0 commit comments

Comments
 (0)