Improved handling of fatal/critical messages in lamexp_message_handler() function.
This commit is contained in:
parent
fb00b2b11e
commit
bf34e9e78f
@ -140,8 +140,7 @@ copy /Y "$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\bin\Win32\*.manifes
|
||||
<CreateHotpatchableImage>false</CreateHotpatchableImage>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<OpenMPSupport>false</OpenMPSupport>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<CompileAsManaged>false</CompileAsManaged>
|
||||
<AdditionalOptions>/wd4005 %(AdditionalOptions)</AdditionalOptions>
|
||||
@ -167,10 +166,10 @@ copy /Y "$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\bin\Win32\*.manifes
|
||||
<EntryPointSymbol>lamexp_entry_point</EntryPointSymbol>
|
||||
<MapFileName>
|
||||
</MapFileName>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
<CreateHotPatchableImage>
|
||||
</CreateHotPatchableImage>
|
||||
<AdditionalLibraryDirectories>$(QTDIR)\lib;$(QTDIR)\plugins\imageformats;$(SolutionDir)\etc\Prerequisites\VisualLeakDetector\lib\Win32;$(SolutionDir)\etc\Prerequisites\keccak\lib\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Copy plugin DLL%27s</Message>
|
||||
|
@ -523,8 +523,14 @@ static void lamexp_console_color(FILE* file, WORD attributes)
|
||||
*/
|
||||
void lamexp_message_handler(QtMsgType type, const char *msg)
|
||||
{
|
||||
static volatile bool bFatalFlag = false;
|
||||
static const char *GURU_MEDITATION = "\n\nGURU MEDITATION !!!\n\n";
|
||||
|
||||
if(bFatalFlag || (msg == NULL))
|
||||
{
|
||||
return; //We are about to terminate, discard any further messages!
|
||||
}
|
||||
|
||||
QMutexLocker lock(&g_lamexp_message_mutex);
|
||||
|
||||
if(g_lamexp_log_file)
|
||||
@ -546,6 +552,7 @@ void lamexp_message_handler(QtMsgType type, const char *msg)
|
||||
{
|
||||
case QtCriticalMsg:
|
||||
case QtFatalMsg:
|
||||
bFatalFlag = true;
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
lamexp_console_color(stderr, FOREGROUND_RED | FOREGROUND_INTENSITY);
|
||||
@ -590,7 +597,7 @@ void lamexp_message_handler(QtMsgType type, const char *msg)
|
||||
OutputDebugStringA(temp.toLatin1().constData());
|
||||
}
|
||||
|
||||
if(type == QtCriticalMsg || type == QtFatalMsg)
|
||||
if(bFatalFlag)
|
||||
{
|
||||
lock.unlock();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user