3662: Don't allocate the windows console default r=def- a=Jupeyy

fixes #3661

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
bors[bot] 2021-03-02 08:03:25 +00:00 committed by GitHub
commit f78bbb5864
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View file

@ -1890,7 +1890,7 @@ if(CLIENT)
# Target
set(TARGET_CLIENT ${CLIENT_EXECUTABLE})
add_executable(${TARGET_CLIENT}
add_executable(${TARGET_CLIENT} WIN32
${CLIENT_SRC}
${CLIENT_ICON}
${CLIENT_MANIFEST}

View file

@ -4270,10 +4270,12 @@ int main(int argc, const char **argv) // ignore_convention
if(str_comp("-s", argv[i]) == 0 || str_comp("--silent", argv[i]) == 0) // ignore_convention
{
Silent = true;
}
else if(str_comp("-c", argv[i]) == 0 || str_comp("--console", argv[i]) == 0) // ignore_convention
{
#if defined(CONF_FAMILY_WINDOWS)
FreeConsole();
AllocConsole();
#endif
break;
}
}
@ -4367,6 +4369,11 @@ int main(int argc, const char **argv) // ignore_convention
pConsole->ExecuteFile(CONFIG_FILE);
}
#if defined(CONF_FAMILY_WINDOWS)
if(g_Config.m_ClShowConsole)
AllocConsole();
#endif
// execute autoexec file
File = pStorage->OpenFile(AUTOEXEC_CLIENT_FILE, IOFLAG_READ, IStorage::TYPE_ALL);
if(File)
@ -4408,11 +4415,6 @@ int main(int argc, const char **argv) // ignore_convention
pClient->Engine()->InitLogfile();
#if defined(CONF_FAMILY_WINDOWS)
if(!g_Config.m_ClShowConsole)
FreeConsole();
#endif
// run the client
dbg_msg("client", "starting...");
pClient->Run();