Skip to content

Commit 94c6d80

Browse files
author
Kolleck, Martin
committed
Fix deadlock when using WARN_AS_ERROR = YES.
1 parent 39d20a3 commit 94c6d80

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/message.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ static void handle_warn_as_error()
122122
{
123123
if (warnBehavior == WARN_YES)
124124
{
125-
std::unique_lock<std::mutex> lock(g_mutex);
126-
QCString msgText = " (warning treated as error, aborting now)\n";
127-
fwrite(msgText.data(),1,msgText.length(),warnFile);
125+
{
126+
std::unique_lock<std::mutex> lock(g_mutex);
127+
QCString msgText = " (warning treated as error, aborting now)\n";
128+
fwrite(msgText.data(),1,msgText.length(),warnFile);
129+
}
128130
exit(1);
129131
}
130132
warnStat = true;

0 commit comments

Comments
 (0)