[insight-vmi] r1995 committed - Protect printing of type rule errors by a mutex to prevent crashes whe...

0 views
Skip to first unread message

insig...@googlecode.com

unread,
Jun 24, 2013, 10:45:03 AM6/24/13
to insight-v...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages