QCommandLineParser: call qCoreApp post routines before ::exit()
This gives a chance for some cleanups at least. Change-Id: I3a628e32c6fc8c7fa00943769210c517005f2a0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
4c002a8343
commit
4e24ff2e68
@ -46,6 +46,8 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
extern void Q_CORE_EXPORT qt_call_post_routines();
|
||||||
|
|
||||||
typedef QHash<QString, int> NameHash_t;
|
typedef QHash<QString, int> NameHash_t;
|
||||||
|
|
||||||
class QCommandLineParserPrivate
|
class QCommandLineParserPrivate
|
||||||
@ -580,6 +582,7 @@ void QCommandLineParser::process(const QStringList &arguments)
|
|||||||
{
|
{
|
||||||
if (!d->parse(arguments)) {
|
if (!d->parse(arguments)) {
|
||||||
showParserMessage(errorText() + QLatin1Char('\n'), ErrorMessage);
|
showParserMessage(errorText() + QLatin1Char('\n'), ErrorMessage);
|
||||||
|
qt_call_post_routines();
|
||||||
::exit(EXIT_FAILURE);
|
::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -990,6 +993,7 @@ Q_NORETURN void QCommandLineParser::showVersion()
|
|||||||
showParserMessage(QCoreApplication::applicationName() + QLatin1Char(' ')
|
showParserMessage(QCoreApplication::applicationName() + QLatin1Char(' ')
|
||||||
+ QCoreApplication::applicationVersion() + QLatin1Char('\n'),
|
+ QCoreApplication::applicationVersion() + QLatin1Char('\n'),
|
||||||
UsageMessage);
|
UsageMessage);
|
||||||
|
qt_call_post_routines();
|
||||||
::exit(EXIT_SUCCESS);
|
::exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1007,6 +1011,7 @@ Q_NORETURN void QCommandLineParser::showVersion()
|
|||||||
Q_NORETURN void QCommandLineParser::showHelp(int exitCode)
|
Q_NORETURN void QCommandLineParser::showHelp(int exitCode)
|
||||||
{
|
{
|
||||||
showParserMessage(d->helpText(), UsageMessage);
|
showParserMessage(d->helpText(), UsageMessage);
|
||||||
|
qt_call_post_routines();
|
||||||
::exit(exitCode);
|
::exit(exitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user