Skip to content

Commit fd83448

Browse files
committed
lock only the overlay
1 parent 14bd772 commit fd83448

File tree

1 file changed

+6
-3
lines changed
  • SerialPrograms/Source/NintendoSwitch/DevPrograms

1 file changed

+6
-3
lines changed

SerialPrograms/Source/NintendoSwitch/DevPrograms/BoxDraw.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,12 @@ class BoxDraw::DrawnBox : public ConfigOption::Listener, public VideoOverlay::Mo
6767
}
6868
}
6969
virtual void on_config_value_changed(void* object) override{
70-
// std::lock_guard<std::mutex> lg(m_lock);
71-
m_overlay_set.clear();
72-
m_overlay_set.add(COLOR_RED, {m_parent.X, m_parent.Y, m_parent.WIDTH, m_parent.HEIGHT});
70+
{
71+
std::lock_guard<std::mutex> lg(m_lock);
72+
m_overlay_set.clear();
73+
m_overlay_set.add(COLOR_RED, {m_parent.X, m_parent.Y, m_parent.WIDTH, m_parent.HEIGHT});
74+
}
75+
7376
if (object == &m_parent.X || object == &m_parent.Y || object == &m_parent.WIDTH || object == &m_parent.HEIGHT){
7477
m_parent.update_box_coordinates();
7578
}

0 commit comments

Comments
 (0)