diff options
author | Andrew Knight <andrew.knight@digia.com> | 2014-01-05 01:56:38 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-07 10:55:51 +0100 |
commit | 1f31c6c6b1f4b37806aa5c1c426efb31ac78ed5e (patch) | |
tree | 47bb885c0780d878425f6f67758760ffaca39da2 | |
parent | d5e52ecf6da473591edd83dc6609301421fc51b9 (diff) |
WinRT: Properly return exit code
Instead of returning the HRESULT of the Run method, return the actual
exit code of the application.
Change-Id: I1e3d654ecdb4c319d4a08fe8a11e8699d186f66b
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
-rw-r--r-- | src/winmain/qtmain_winrt.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp index 09efd01667..aead5ca0d0 100644 --- a/src/winmain/qtmain_winrt.cpp +++ b/src/winmain/qtmain_winrt.cpp @@ -77,6 +77,8 @@ using namespace Microsoft::WRL; #define CoreApplicationClass RuntimeClass_Windows_ApplicationModel_Core_CoreApplication typedef ITypedEventHandler<Core::CoreApplicationView *, Activation::IActivatedEventArgs *> ActivatedHandler; +static int g_mainExitCode; + class AppContainer : public Microsoft::WRL::RuntimeClass<Core::IFrameworkView> { public: @@ -109,7 +111,8 @@ public: while (!IsDebuggerPresent()) WaitForSingleObjectEx(GetCurrentThread(), 1, true); } - return main(m_argv.count(), m_argv.data()); + g_mainExitCode = main(m_argv.count(), m_argv.data()); + return S_OK; } HRESULT __stdcall Uninitialize() { return S_OK; } @@ -178,5 +181,6 @@ int WinMain() if (FAILED(RoGetActivationFactory(qHString(CoreApplicationClass), IID_PPV_ARGS(&appFactory)))) return 2; - return appFactory->Run(Make<AppViewSource>(argc, argv).Get()); + appFactory->Run(Make<AppViewSource>(argc, argv).Get()); + return g_mainExitCode; } |