Fix rare crash when calling SetExternalResource old/5.1
authorSimon Hausmann <simon.hausmann@digia.com>
Wed, 11 Sep 2013 07:14:33 +0000 (09:14 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 11 Sep 2013 16:48:08 +0000 (18:48 +0200)
commita48ae1d629f4c7939f3421db969f43db6bab8e11
tree0d286fbf47f68a01705bf2b29d486e807436eeb9
parent0a8af38cf0add7592bf8f491e45a5de8b125a190
Fix rare crash when calling SetExternalResource

This is a patch on top of the original patch that adds support for
external resources to v8::Object.

When the provided external resource pointer cannot be encoded in SMI, then we
need to allocate an object on the heap to hold it. That in turn may trigger a
garbage collection, which in turn may end up collecting the object itself.
Similarly to other methods dealing with the allocation of i::Foreign, the
insertion of a HandleScope is required.

Done-with: Lars
Task-Number: QTBUG-29127

Change-Id: I9a99998e2fbfcb8a4c1e31595344680123072c6b
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/3rdparty/v8/src/api.cc