Merge pull request #6898 from Atlante45/fix/ds-shutdown-debug

Postpone logging of the shutdown reason
This commit is contained in:
Stephen Birarda 2016-01-21 18:31:19 -08:00
commit 40f2afb284
2 changed files with 7 additions and 5 deletions

View file

@ -184,13 +184,15 @@ bool HTTPManager::bindSocket() {
return true; return true;
} else { } else {
qCritical() << "Failed to open HTTP server socket:" << errorString() << " can't continue"; QString errorMessage = "Failed to open HTTP server socket: " + errorString() + ", can't continue";
QMetaObject::invokeMethod(this, "queuedExit", Qt::QueuedConnection); QMetaObject::invokeMethod(this, "queuedExit", Qt::QueuedConnection, Q_ARG(QString, errorMessage));
return false; return false;
} }
} }
void HTTPManager::queuedExit() { void HTTPManager::queuedExit(QString errorMessage) {
if (!errorMessage.isEmpty()) {
qCCritical(embeddedwebserver) << qPrintable(errorMessage);
}
QCoreApplication::exit(SOCKET_ERROR_EXIT_CODE); QCoreApplication::exit(SOCKET_ERROR_EXIT_CODE);
} }

View file

@ -39,7 +39,7 @@ public:
private slots: private slots:
void isTcpServerListening(); void isTcpServerListening();
void queuedExit(); void queuedExit(QString errorMessage);
private: private:
bool bindSocket(); bool bindSocket();