diff --git a/rpcs3/Emu/RSX/Overlays/overlay_message.cpp b/rpcs3/Emu/RSX/Overlays/overlay_message.cpp index c3b48b89ce..ba181cc6e8 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_message.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_message.cpp @@ -132,9 +132,16 @@ namespace rsx { const u64 cur_time = rsx::uclock(); - while (!vis_set.empty() && vis_set.front().get_expiration() < cur_time) + for (auto it = vis_set.begin(); it != vis_set.end();) { - vis_set.pop_front(); + if (it->get_expiration() < cur_time) + { + it = vis_set.erase(it); + } + else + { + it++; + } } while (vis_set.size() < max_visible_items && !ready_set.empty()) diff --git a/rpcs3/Emu/RSX/Overlays/overlay_message.h b/rpcs3/Emu/RSX/Overlays/overlay_message.h index 9acbffc68b..53baedc2a8 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_message.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_message.h @@ -37,9 +37,9 @@ namespace rsx u64 m_expiration_time = 0; u64 m_visible_duration = 0; std::shared_ptr> m_refs; - bool m_processed = false; - usz m_cur_pos = umax; - const u16 m_margin = 6; + bool m_processed = false; + usz m_cur_pos = umax; + static constexpr u16 m_margin = 6; }; class message final : public overlay