From 0a20108113e09025618481ac2ffd1157c4b92359 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 23 Mar 2010 09:56:15 +1000 Subject: Fix mutex handling that was causing tests to sometimes crash/fail. --- src/declarative/qml/qdeclarativeworkerscript.cpp | 4 ++-- .../declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp | 5 ----- 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; -- cgit v0.12