Fix crashes caused by handle management in worker threads
authorChris Adams <christopher.adams@nokia.com>
Fri, 7 Oct 2011 00:01:40 +0000 (10:01 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 10 Oct 2011 03:47:37 +0000 (05:47 +0200)
commitd0f118d311ec7d051360fb406f5daada2bf4fba7
treeee097697c35c3b6b5205453adf8b514da6a89b57
parentca47f27900f6f0ebc35f87a28746376475212249
Fix crashes caused by handle management in worker threads

Previously, the QV8Engine destructor and the QV8Engine's QV8GCCallback
Referencer destructor would crash if run after the v8 isolate had been
exited and disposed.  This commit Q_ASSERTs if the worker thread
attempts to do so, and adds a cleanup function which worker threads
should call just prior to exiting the isolate.

Task-number: QTBUG-21866
Change-Id: I379b02e24ad9378e4bfc270fb9208715b6f7b60a
Reviewed-on: http://codereview.qt-project.org/6202
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
src/declarative/qml/qdeclarativeworkerscript.cpp
src/declarative/qml/v8/qv8engine.cpp
src/declarative/qml/v8/qv8gccallback_p.h