Skip to content
Snippets Groups Projects
Verified Commit 4c34f4bf authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Work around multiple destructor calls after consteval construction in full expression

I have no idea, if this is our fault or not, but Jason traced it back to
the consteval on the {fmt} format string constructor.

Specifically when a consteval constructor call happens in the statement,
the destructor call is moved to the end of the block. Inside the switch
statement that means, the destructor is called multiple times, which
corrupts the use count and crashes Nheko because of a double free.

I am assuming this is a bug in clang, but this will need to be
investigated more.

fixes #1292
parent b4c05819
No related branches found
No related tags found
No related merge requests found
Pipeline #4201 passed
......@@ -45,19 +45,19 @@ qmlMessageHandler(QtMsgType type, const QMessageLogContext &context, const QStri
switch (type) {
case QtDebugMsg:
nhlog::qml()->debug("{} ({}:{}, {})", localMsg, file, context.line, function);
qml_logger->debug("{} ({}:{}, {})", localMsg, file, context.line, function);
break;
case QtInfoMsg:
nhlog::qml()->info("{} ({}:{}, {})", localMsg, file, context.line, function);
qml_logger->info("{} ({}:{}, {})", localMsg, file, context.line, function);
break;
case QtWarningMsg:
nhlog::qml()->warn("{} ({}:{}, {})", localMsg, file, context.line, function);
qml_logger->warn("{} ({}:{}, {})", localMsg, file, context.line, function);
break;
case QtCriticalMsg:
nhlog::qml()->critical("{} ({}:{}, {})", localMsg, file, context.line, function);
qml_logger->critical("{} ({}:{}, {})", localMsg, file, context.line, function);
break;
case QtFatalMsg:
nhlog::qml()->critical("{} ({}:{}, {})", localMsg, file, context.line, function);
qml_logger->critical("{} ({}:{}, {})", localMsg, file, context.line, function);
break;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment