From 99d23a31d84f1c36a8684f3e151f7e339295b92a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 15 Apr 2013 22:45:21 +0200 Subject: [PATCH] Fix a bug in the v8 API wrapper This gets us further in the qjsengine autotest. Change-Id: I911c893b49d34b6ee2226a82dc4bb7f398f57d5a Reviewed-by: Simon Hausmann --- src/qml/qml/v4vm/qv4v8_p.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/qml/qml/v4vm/qv4v8_p.h b/src/qml/qml/v4vm/qv4v8_p.h index 35fcf5b..7496e16 100644 --- a/src/qml/qml/v4vm/qv4v8_p.h +++ b/src/qml/qml/v4vm/qv4v8_p.h @@ -202,6 +202,10 @@ struct HandleOperations handle->int_32 = 0; #endif } + static void init(Handle *handle, T *other) + { + handle->val = *reinterpret_cast(other); + } static void ref(Handle *) { @@ -245,6 +249,10 @@ struct HandleOperations { \ handle->object = 0; \ } \ + static void init(Handle *handle, Type *obj) \ + { \ + handle->object = obj; \ + } \ \ static void ref(Handle *handle) \ { \ @@ -288,7 +296,7 @@ struct Handle { explicit Handle(T *obj) { - object = obj; + HandleOperations::init(this, obj); HandleOperations::ref(this); } -- 2.7.4