Skip to content

Commit 96ee343

Browse files
fixes for windows
1 parent e675657 commit 96ee343

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cocos/scripting/js-bindings/manual/cocos2d_specifics.hpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ inline js_proxy_t *js_get_or_create_proxy(JSContext *cx, T *native_obj) {
105105
JS::RootedObject js_obj(cx, JS_NewObject(cx, typeProxy->jsclass, proto, parent));
106106
proxy = jsb_new_proxy(native_obj, js_obj);
107107
#ifdef DEBUG
108-
AddNamedObjectRoot(cx, &proxy->obj, typeid(*native_obj).name());
108+
JS::AddNamedObjectRoot(cx, &proxy->obj, typeid(*native_obj).name());
109109
#else
110-
AddObjectRoot(cx, &proxy->obj);
110+
JS::AddObjectRoot(cx, &proxy->obj);
111111
#endif
112112
return proxy;
113113
} else {
@@ -133,7 +133,11 @@ JSObject* js_get_or_create_jsobject(JSContext *cx, typename std::enable_if<!std:
133133
JS::RootedObject parent(cx, typeClass->parentProto.ref().get());
134134
JS::RootedObject js_obj(cx, JS_NewObject(cx, typeClass->jsclass, proto, parent));
135135
proxy = jsb_new_proxy(native_obj, js_obj);
136+
#ifdef DEBUG
136137
AddNamedObjectRoot(cx, &proxy->obj, typeid(*native_obj).name());
138+
#else
139+
AddObjectRoot(cx, &proxy->obj);
140+
#endif
137141
}
138142
return proxy->obj;
139143
}

0 commit comments

Comments
 (0)