/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
QCoreApplication::postEvent(d, new QEvent((QEvent::Type)QDeclarativeWorkerScriptEnginePrivate::WorkerDestroyEvent));
d->m_lock.unlock();
+ //We have to force to cleanup the main thread's event queue here
+ //to make sure the main GUI release all pending locks/wait conditions which
+ //some worker script/agent are waiting for (QDeclarativeListModelWorkerAgent::sync() for example).
+ QCoreApplication::processEvents();
wait();
d->deleteLater();
}
{
d->m_lock.lock();
- v8::Isolate *isolate = v8::Isolate::New();
- isolate->Enter();
-
d->workerEngine = new QDeclarativeWorkerScriptEnginePrivate::WorkerEngine(d);
d->workerEngine->init();
d->workers.clear();
delete d->workerEngine; d->workerEngine = 0;
- QV8GCCallback::releaseWorkerThreadGcPrologueCallbackData();
- isolate->Exit();
- isolate->Dispose();
}