QLogging: attempt to free memory in qt_message() before abort()
Just so memory leak checkers won't complain. Change-Id: I2b24e1d3cad44897906efffd177fb9ddf0eb0a2a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit b24630ce028847e52dfcf23769f5d19fb1c33c03) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
02fd6ca5e7
commit
23c87ff341
@ -163,10 +163,11 @@ Q_TRACE_POINT(qtcore, qt_message_print, int type, const char *category, const ch
|
|||||||
\snippet code/src_corelib_global_qglobal.cpp 4
|
\snippet code/src_corelib_global_qglobal.cpp 4
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
template <typename String>
|
||||||
#if !defined(Q_CC_MSVC_ONLY)
|
#if !defined(Q_CC_MSVC_ONLY)
|
||||||
Q_NORETURN
|
Q_NORETURN
|
||||||
#endif
|
#endif
|
||||||
static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message);
|
static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, String &&message);
|
||||||
static void qt_message_print(QtMsgType, const QMessageLogContext &context, const QString &message);
|
static void qt_message_print(QtMsgType, const QMessageLogContext &context, const QString &message);
|
||||||
static void qt_message_print(const QString &message);
|
static void qt_message_print(const QString &message);
|
||||||
|
|
||||||
@ -1998,7 +1999,8 @@ static void qt_message_print(const QString &message)
|
|||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message)
|
template <typename String>
|
||||||
|
static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, String &&message)
|
||||||
{
|
{
|
||||||
#if defined(Q_CC_MSVC_ONLY) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
|
#if defined(Q_CC_MSVC_ONLY) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
|
||||||
wchar_t contextFileL[256];
|
wchar_t contextFileL[256];
|
||||||
@ -2019,13 +2021,15 @@ static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const
|
|||||||
_CrtDbgBreak();
|
_CrtDbgBreak();
|
||||||
#else
|
#else
|
||||||
Q_UNUSED(context);
|
Q_UNUSED(context);
|
||||||
Q_UNUSED(message);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if constexpr (std::is_class_v<String> && !std::is_const_v<String>)
|
||||||
|
message.clear();
|
||||||
|
else
|
||||||
|
Q_UNUSED(message);
|
||||||
qAbort();
|
qAbort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user