Skip to content

Commit 8bca458

Browse files
committed
Ultrawide: Forgot to protect FOV map
1 parent 007b908 commit 8bca458

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/mods/Graphics.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,15 @@ void Graphics::set_vertical_fov(bool enable) {
456456
if (m_ultrawide_fov->value() && get_fov_method != nullptr && set_fov_method != nullptr && get_aspect_method != nullptr) {
457457
const auto fov = get_fov_method->call<float>(sdk::get_thread_context(), camera);
458458

459-
if (!m_fov_map.contains(camera)) {
460-
m_fov_map[camera] = fov;
461-
utility::re_managed_object::add_ref(camera);
462-
} else {
463-
m_fov_map[camera] = fov;
459+
{
460+
std::scoped_lock _{m_fov_mutex};
461+
462+
if (!m_fov_map.contains(camera)) {
463+
m_fov_map[camera] = fov;
464+
utility::re_managed_object::add_ref(camera);
465+
} else {
466+
m_fov_map[camera] = fov;
467+
}
464468
}
465469

466470
if (!was_vertical_fov_enabled) {

0 commit comments

Comments
 (0)