summaryrefslogtreecommitdiffstats
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
parentc3d8fef05b011a737ce15791e94aef84d27d1b8f (diff)
downloadQt-0a20108113e09025618481ac2ffd1157c4b92359.zip
Qt-0a20108113e09025618481ac2ffd1157c4b92359.tar.gz
Qt-0a20108113e09025618481ac2ffd1157c4b92359.tar.bz2
Fix mutex handling that was causing tests to sometimes crash/fail.
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp5
2 files changed, 2 insertions, 7 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();
}
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index 7a10ad0..576fe21 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -290,8 +290,6 @@ void tst_QDeclarativeListModel::dynamic_worker_data()
void tst_QDeclarativeListModel::dynamic_worker()
{
- QSKIP("Skip, awaiting imminent fixes", SkipAll);
-
QFETCH(QString, script);
QFETCH(int, result);
QFETCH(QString, warning);
@@ -342,7 +340,6 @@ void tst_QDeclarativeListModel::dynamic_worker()
void tst_QDeclarativeListModel::convertNestedToFlat_fail()
{
- QSKIP("Skip, awaiting imminent fixes", SkipAll);
// If a model has nested data, it cannot be used at all from a worker script
QFETCH(QString, script);
@@ -390,8 +387,6 @@ void tst_QDeclarativeListModel::convertNestedToFlat_ok()
// If a model only has plain data, it can be modified from a worker script. However,
// once the model is used from a worker script, it no longer accepts nested data
- QSKIP("Skip, awaiting imminent fixes", SkipAll);
-
QFETCH(QString, script);
QDeclarativeListModel model;