mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-15 07:44:10 +00:00
UI: Protect debug text static string var with mutex
This commit is contained in:
parent
9050febf06
commit
85c43cd666
|
@ -318,9 +318,12 @@ static void do_log(int log_level, const char *msg, va_list args, void *param)
|
|||
|
||||
#ifdef _WIN32
|
||||
if (IsDebuggerPresent()) {
|
||||
static wstring wide_buf;
|
||||
int wNum = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
|
||||
if (wNum > 1) {
|
||||
static wstring wide_buf;
|
||||
static mutex wide_mutex;
|
||||
|
||||
lock_guard<mutex> lock(wide_mutex);
|
||||
wide_buf.reserve(wNum + 1);
|
||||
wide_buf.resize(wNum - 1);
|
||||
MultiByteToWideChar(CP_UTF8, 0, str, -1, &wide_buf[0],
|
||||
|
|
Loading…
Reference in a new issue