From 4e24ff2e68f942db1d8f90de43dae8db410e706b Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 7 Aug 2016 22:32:33 +0200 Subject: QCommandLineParser: call qCoreApp post routines before ::exit() This gives a chance for some cleanups at least. Change-Id: I3a628e32c6fc8c7fa00943769210c517005f2a0a Reviewed-by: Thiago Macieira --- src/corelib/tools/qcommandlineparser.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp index 2bc60c5b9e..fa163cf441 100644 --- a/src/corelib/tools/qcommandlineparser.cpp +++ b/src/corelib/tools/qcommandlineparser.cpp @@ -46,6 +46,8 @@ QT_BEGIN_NAMESPACE +extern void Q_CORE_EXPORT qt_call_post_routines(); + typedef QHash NameHash_t; class QCommandLineParserPrivate @@ -580,6 +582,7 @@ void QCommandLineParser::process(const QStringList &arguments) { if (!d->parse(arguments)) { showParserMessage(errorText() + QLatin1Char('\n'), ErrorMessage); + qt_call_post_routines(); ::exit(EXIT_FAILURE); } @@ -990,6 +993,7 @@ Q_NORETURN void QCommandLineParser::showVersion() showParserMessage(QCoreApplication::applicationName() + QLatin1Char(' ') + QCoreApplication::applicationVersion() + QLatin1Char('\n'), UsageMessage); + qt_call_post_routines(); ::exit(EXIT_SUCCESS); } @@ -1007,6 +1011,7 @@ Q_NORETURN void QCommandLineParser::showVersion() Q_NORETURN void QCommandLineParser::showHelp(int exitCode) { showParserMessage(d->helpText(), UsageMessage); + qt_call_post_routines(); ::exit(exitCode); } -- cgit v1.2.3