qFatal: unify the code path for aborting via std::abort
[ChangeLog][QtCore][Important behavior changes] qFatal will now use std::abort to terminate the application on all operating systems. Previously, ::abort() or ::exit(1) were called, depending on the operating system. Change-Id: I43da912cce1db3c2229568da25000ea80060eed9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
c0aaef30b1
commit
25d6f312ac
@ -4479,7 +4479,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
|
|||||||
On QNX the message is sent to slogger2
|
On QNX the message is sent to slogger2
|
||||||
|
|
||||||
If you are using the \b{default message handler} this function will
|
If you are using the \b{default message handler} this function will
|
||||||
abort on Unix systems to create a core dump. On Windows, for debug builds,
|
abort to create a core dump. On Windows, for debug builds,
|
||||||
this function will report a _CRT_ERROR enabling you to connect a debugger
|
this function will report a _CRT_ERROR enabling you to connect a debugger
|
||||||
to the application.
|
to the application.
|
||||||
|
|
||||||
|
@ -140,6 +140,8 @@ static QT_PREPEND_NAMESPACE(qint64) qt_gettid()
|
|||||||
#endif
|
#endif
|
||||||
#endif // !QT_BOOTSTRAPPED
|
#endif // !QT_BOOTSTRAPPED
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -1676,11 +1678,7 @@ static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const
|
|||||||
Q_UNUSED(message);
|
Q_UNUSED(message);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(Q_OS_UNIX) || defined(Q_CC_MINGW))
|
std::abort();
|
||||||
abort(); // trap; generates core dump
|
|
||||||
#else
|
|
||||||
exit(1); // goodbye cruel world
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user