(WIN32) Skip console attach when logging to file (#14163)

This commit is contained in:
sonninnos 2022-07-09 20:22:59 +03:00 committed by GitHub
parent 05fb6fd9a3
commit b44ad6f890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -699,6 +699,9 @@ static void frontend_win32_attach_console(void)
bool need_stderr = (GetFileType(GetStdHandle(STD_ERROR_HANDLE))
== FILE_TYPE_UNKNOWN);
if (config_get_ptr()->bools.log_to_file)
return;
if (need_stdout || need_stderr)
{
if (!AttachConsole(ATTACH_PARENT_PROCESS))
@ -713,7 +716,6 @@ static void frontend_win32_attach_console(void)
console_needs_free = true;
}
#endif
#endif
}