From e51318768d2bc0cc2dc6dd38a67a9241b36149e8 Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Sun, 16 Apr 2023 16:09:51 +0200 Subject: [PATCH] Fix websocket events not being processed This could happen if a websocket event message arrived just after the macro condition checks of the current interval completed and just before the websocket event message buffers were cleared. --- src/utils/websocket-helpers.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/websocket-helpers.cpp b/src/utils/websocket-helpers.cpp index b87ee040..dc89d50f 100644 --- a/src/utils/websocket-helpers.cpp +++ b/src/utils/websocket-helpers.cpp @@ -270,6 +270,7 @@ void WSConnection::HandleEvent(obs_data_t *msg) return; } auto eventDataNested = obs_data_get_obj(eventData, "eventData"); + std::lock_guard lock(switcher->m); _messages.emplace_back(obs_data_get_string(eventDataNested, "message")); vblog(LOG_INFO, "received event msg \"%s\"", obs_data_get_string(eventDataNested, "message"));