aboutsummaryrefslogtreecommitdiffstats
path: root/Samples/CommonSrc/Platform/Win32_Platform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Samples/CommonSrc/Platform/Win32_Platform.cpp')
-rw-r--r--Samples/CommonSrc/Platform/Win32_Platform.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Samples/CommonSrc/Platform/Win32_Platform.cpp b/Samples/CommonSrc/Platform/Win32_Platform.cpp
index eeab429..09830d2 100644
--- a/Samples/CommonSrc/Platform/Win32_Platform.cpp
+++ b/Samples/CommonSrc/Platform/Win32_Platform.cpp
@@ -563,7 +563,7 @@ int WINAPI WinMain(HINSTANCE hinst, HINSTANCE prevInst, LPSTR inArgs, int show)
// Nested scope for container destructors to shutdown before DestroyApplication.
{
Array<String> args;
- Array<const char*> argv;
+ Array<char*> argv;
argv.PushBack("app");
const char* p = inArgs;
@@ -584,8 +584,9 @@ int WINAPI WinMain(HINSTANCE hinst, HINSTANCE prevInst, LPSTR inArgs, int show)
}
if (p != pstart)
args.PushBack(String(pstart, p - pstart));
+ // FIXME memory leak of the command line arguments here
for (UPInt i = 0; i < args.GetSize(); i++)
- argv.PushBack(args[i].ToCStr());
+ argv.PushBack(strdup(args[i].ToCStr()));
exitCode = g_app->OnStartup((int)argv.GetSize(), &argv[0]);
if (!exitCode)