Revision: 1995
Author:
chrsc...@googlemail.com
Date: Mon Jun 24 07:44:43 2013
Log: Protect printing of type rule errors by a mutex to prevent
crashes when
errors occur simultaniously in multiple threads.
http://code.google.com/p/insight-vmi/source/detail?r=1995
Modified:
/trunk/libinsight/typerule.cpp
=======================================
--- /trunk/libinsight/typerule.cpp Sat Feb 16 11:44:29 2013
+++ /trunk/libinsight/typerule.cpp Mon Jun 24 07:44:43 2013
@@ -200,8 +200,12 @@
void ScriptAction::warnEvalError(const ScriptEngine *eng,
const QString &fileName) const
{
+ static QMutex mutex;
// Print errors as warnings
if (eng && eng->lastEvaluationFailed()) {
+ // Do this exclusively
+ QMutexLocker lock(&mutex);
+
QString file(ShellUtil::shortFileName(fileName));
Console::err() << Console::color(ctWarning) << "At "
<< Console::color(ctBold) << file