UnityWebGL.js icon indicating copy to clipboard operation
UnityWebGL.js copied to clipboard

unload function cause my page crashed

Open AbbetWang opened this issue 1 year ago • 2 comments

I have a situation where, after packaging my Unity project as WebGL and calling unload function, the tab in Google Chrome becomes unresponsive. The DevTools for that tab are also unavailable. When I check the Google Chrome Task Manager, I see that the CPU usage for that tab's process is around 100%. This issue seems to occur shortly after calling unityInstance.quit. How can I resolve this problem to prevent the webpage from freezing and consuming high CPU resources?

AbbetWang avatar Aug 07 '24 12:08 AbbetWang

I'm not experiencing this, can you provide an online example?

Marinerer avatar Aug 10 '24 06:08 Marinerer

I think the same thing happened to me. I wanted to destroy unity when I switched pages, so I called unload(), causing the browser TAB to freeze and become unresponsive.

imleeou avatar Aug 14 '24 03:08 imleeou

Check for a long time, found that it seems to be a problem with unity resources, I use oss resources in the author demo, there will be no tab page card dead problem, embarrassing. loaderUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.loader.js", dataUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.data", frameworkUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.framework.js", codeUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.wasm"

imleeou avatar Aug 19 '24 05:08 imleeou