summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-03-22 23:56:15 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-03-23 00:04:13 (GMT)
commit0a20108113e09025618481ac2ffd1157c4b92359 (patch)
treef5a39e5258aba50a3956e0463a647a15e8c177bc /src/declarative
parentc3d8fef05b011a737ce15791e94aef84d27d1b8f (diff)
downloadQt-0a20108113e09025618481ac2ffd1157c4b92359.zip
Qt-0a20108113e09025618481ac2ffd1157c4b92359.tar.gz
Qt-0a20108113e09025618481ac2ffd1157c4b92359.tar.bz2
Fix mutex handling that was causing tests to sometimes crash/fail.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index 10c0b54..a7ed358 100644
--- a/src/declarative/qml/qdeclarativeworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -201,11 +201,11 @@ QScriptValue QDeclarativeWorkerScriptEnginePrivate::sendMessage(QScriptContext *
if (!script)
return engine->undefinedValue();
- p->m_lock.lock();
+ QMutexLocker(&p->m_lock);
+
if (script->owner)
QCoreApplication::postEvent(script->owner,
new WorkerDataEvent(0, scriptValueToVariant(ctxt->argument(0))));
- p->m_lock.unlock();
return engine->undefinedValue();
}