winrt: Remove explicit exit call

8c3ae221 introduced a mean to actually close an application. Otherwise
the application was in an undefined state and did not exit.

Since 5.6 we switched to Xaml and the explicit call to Exit() is not
required anymore. This also allows using multiple application objects
sequentially as the unit tests do in some cases.

Change-Id: I9030afec72a4534e818c77c373dc3a81b922a480
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
bb10
Maurice Kalinowski 2016-02-12 11:59:24 +01:00 committed by Maurice Kalinowski
parent ba3d492134
commit 34fd680802
1 changed files with 0 additions and 13 deletions

View File

@ -1299,19 +1299,6 @@ void QCoreApplication::exit(int returnCode)
QEventLoop *eventLoop = data->eventLoops.at(i);
eventLoop->exit(returnCode);
}
#ifdef Q_OS_WINRT
qWarning("QCoreApplication::exit: It is not recommended to explicitly exit an application on Windows Store Apps");
ComPtr<ICoreApplication> app;
HRESULT hr = RoGetActivationFactory(Wrappers::HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
IID_PPV_ARGS(&app));
RETURN_VOID_IF_FAILED("Could not acquire ICoreApplication object");
ComPtr<ICoreApplicationExit> appExit;
hr = app.As(&appExit);
RETURN_VOID_IF_FAILED("Could not acquire ICoreApplicationExit object");
hr = appExit->Exit();
RETURN_VOID_IF_FAILED("Could not exit application");
#endif // Q_OS_WINRT
}
/*****************************************************************************