X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fdeclarative%2Fqml%2Fqdeclarativeworkerscript.cpp;h=b17c026e681182dd3f7c99963bf0735aaa5cde61;hb=45b14259fc0cf704692df1c00da511527d1fba1d;hp=4e2bcdda01b1c2e02fa52df0e3b9d2ef5da3b0fe;hpb=b0133b8fa4b1ad9a887fa6718983711b560a35ef;p=profile%2Fivi%2Fqtdeclarative.git diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp index 4e2bcdd..b17c026 100644 --- a/src/declarative/qml/qdeclarativeworkerscript.cpp +++ b/src/declarative/qml/qdeclarativeworkerscript.cpp @@ -1,8 +1,7 @@ /**************************************************************************** ** -** 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. ** @@ -35,6 +34,7 @@ ** ** ** +** ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -478,6 +478,10 @@ QDeclarativeWorkerScriptEngine::~QDeclarativeWorkerScriptEngine() 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(); } @@ -526,9 +530,6 @@ void QDeclarativeWorkerScriptEngine::run() { d->m_lock.lock(); - v8::Isolate *isolate = v8::Isolate::New(); - isolate->Enter(); - d->workerEngine = new QDeclarativeWorkerScriptEnginePrivate::WorkerEngine(d); d->workerEngine->init(); @@ -542,9 +543,6 @@ void QDeclarativeWorkerScriptEngine::run() d->workers.clear(); delete d->workerEngine; d->workerEngine = 0; - QV8GCCallback::releaseWorkerThreadGcPrologueCallbackData(); - isolate->Exit(); - isolate->Dispose(); }