Don't hang the worker script engine
authorCharles Yin <charles.yin@nokia.com>
Wed, 18 Jan 2012 01:22:31 +0000 (11:22 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 24 Jan 2012 09:53:44 +0000 (10:53 +0100)
commit635d0a7cf6601b2e46e0eed21a648934bc471c6d
treeffe00a240ddf021ce81154ec8db301391aabc1f3
parentc6497e5edcfc533574d4066aa9650eb6967693bc
Don't hang the worker script engine

1. Wake up the syncDone wait condition when delete the QDeclarativeListModelWorkerAgent,
otherwise the the whole worker script engine thread will hang at the sync() call
and can't exit gracefully.
2. Call QCoreApplication::processEvents() before delete the worker script engine to
cleanup all pending events in main thread to release wait conditions which
some worker scripts/agents are waiting for (QDeclarativeListModelWorkerAgent::sync() for example)

Change-Id: Ia3712318771633e68238b4d629ba870ff7ce45b9
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
src/declarative/qml/qdeclarativelistmodelworkeragent.cpp
src/declarative/qml/qdeclarativelistmodelworkeragent_p.h
src/declarative/qml/qdeclarativeworkerscript.cpp