-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Unity-v2] Bug: Check failed: Handle not reset in first callback. See comments on |v8::WeakCallbackInfo|.. #1203
Comments
原因分析: 1、脚本1将产生指针类型的,指向TestArray里头字段js对象。 |
chexiongsheng
added a commit
that referenced
this issue
Feb 13, 2023
…omments on |v8::WeakCallbackInfo|.. fix #1203
附上简化版的用例(仅一个脚本即可) using UnityEngine;
using Puerts;
using System;
public class TestEvent
{
public Vector3[] testArray = { new Vector3(0, 0, 0), new Vector3(0, 0, 0) };
}
public class Test2 : MonoBehaviour
{
private JsEnv jsEnv;
// Start is called before the first frame update
void Start()
{
jsEnv = new JsEnv();
jsEnv.Eval(@"
let o = new CS.TestEvent();
const len = o.testArray.Length;
let cached = [];
for (let j = 0; j < 40000; ++j) {
for(let i = 0; i < len; ++i) {
cached.push(o.testArray.get_Item(i));
}
}
o = undefined;
let List = puer.$generic(CS.System.Collections.Generic.List$1,
CS.System.Int32
);
");
jsEnv.Eval("gc()");
GC.Collect();
GC.WaitForPendingFinalizers();
//jsEnv.Dispose();
UnityEngine.Debug.Log("-------------Start---------------");
}
// Update is called once per frame
void Update()
{
UnityEngine.Debug.Log("--------------Update--------------");
jsEnv.Eval(@"
cached = undefined;
for (let k = 0; k < 10000; ++k) {
let lst = new List();
}
");
}
} 感觉要触发也比较苛刻 |
Tangxinwei
added a commit
to Tangxinwei/puerts
that referenced
this issue
Feb 14, 2023
Merged
chexiongsheng
pushed a commit
that referenced
this issue
Feb 14, 2023
zombieyang
pushed a commit
to zombieyang/puerts
that referenced
this issue
Feb 15, 2023
…omments on |v8::WeakCallbackInfo|.. fix Tencent#1203
zombieyang
pushed a commit
to puerts/puerts_experimental_any_engine
that referenced
this issue
Nov 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
前置阅读 | Pre-reading
Puer的版本 | Puer Version
v2.0.0
Unity的版本 | Unity Version
all
发生在哪个平台 | Platform
All
错误信息 | Error Message
Check failed: Handle not reset in first callback. See comments on |v8::WeakCallbackInfo|..
问题重现 | Bug reproduce
脚本1
脚本2
场景1加载脚本1,场景2加载脚本2
游戏启动后加载场景1.。
一会儿后点击切场景,闪退,日志报:Check failed: Handle not reset in first callback. See comments on |v8::WeakCallbackInfo|..
CrashRepro.zip
The text was updated successfully, but these errors were encountered: