winrt: Add null pointer to the end of the arguments array
Although WinRT doesn't officially support argc/argv, respect C++03 §3.6.1/2 (The value of argv[argc] shall be 0). Task-number: QTCREATORBUG-19705 Change-Id: I190e2923b8a0665cc8975a800619fd916a4dd244 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
This commit is contained in:
parent
59e9c4956c
commit
b33a8cb13d
@ -157,7 +157,7 @@ public:
|
|||||||
|
|
||||||
mainThread = CreateThread(NULL, 0, [](void *param) -> DWORD {
|
mainThread = CreateThread(NULL, 0, [](void *param) -> DWORD {
|
||||||
AppContainer *app = reinterpret_cast<AppContainer *>(param);
|
AppContainer *app = reinterpret_cast<AppContainer *>(param);
|
||||||
int argc = app->args.count();
|
int argc = app->args.count() - 1;
|
||||||
char **argv = app->args.data();
|
char **argv = app->args.data();
|
||||||
const int res = main(argc, argv);
|
const int res = main(argc, argv);
|
||||||
if (app->pidFile != INVALID_HANDLE_VALUE) {
|
if (app->pidFile != INVALID_HANDLE_VALUE) {
|
||||||
@ -305,6 +305,8 @@ private:
|
|||||||
args.remove(i);
|
args.remove(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
args.append(nullptr);
|
||||||
|
|
||||||
if (develMode) {
|
if (develMode) {
|
||||||
// Write a PID file to help runner
|
// Write a PID file to help runner
|
||||||
const QString pidFileName = QDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation))
|
const QString pidFileName = QDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user