mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-01-17 14:28:30 +01:00
Free array we get from CommandLineToArgvW
This commit is contained in:
parent
18c604fd42
commit
f6878dcdb6
@ -532,17 +532,15 @@ int main(int argc, char *argv[]);
|
||||
int WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
{
|
||||
int argc;
|
||||
wchar_t **wargv = CommandLineToArgvW(GetCommandLineW(), &argc);
|
||||
std::vector<ByteString> argv;
|
||||
std::vector<char *> argp;
|
||||
wchar_t **wargv = CommandLineToArgvW(GetCommandLineW(), &argc);
|
||||
for (auto i = 0; i < argc; ++i)
|
||||
{
|
||||
argv.push_back(Platform::WinNarrow(std::wstring(wargv[i])));
|
||||
argp.push_back(&argv.back()[0]);
|
||||
}
|
||||
std::vector<char *> argp;
|
||||
for (auto &arg : argv)
|
||||
{
|
||||
argp.push_back(&arg[0]);
|
||||
}
|
||||
LocalFree(wargv);
|
||||
return main(argc, &argp[0]);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user