Closed rn-lazuka closed 5 months ago
Babel and WebPack JavaScript
Static File Serving
When the Unity Component unmounts
The problem seems Module related
9.5.2
18.2.0
2022.3.19f1
https://github.com/jeffreylanters/react-unity-webgl/assets/58468458/cb51b3ec-690a-4525-ac0e-b9faee06ca1b https://github.com/jeffreylanters/react-unity-webgl/assets/58468458/d63f37e1-0b22-42a1-984d-623ce6a4fc98 I have a multi-page React application, and I created a page specifically for launching all the games I have. The problem is that when I open any game, Unity gets allocated in memory. When I navigate to another page and then open the same game or any other game, a new memory slot gets allocated each time, eventually leading to lags or Unity crashing due to memory issues. I tried using the unload method, and while the logs indicate it's working, I don't see any actual memory being freed. I've resorted to reloading the page to free up memory, but is there another solution?
Just create multipage app and try to open game few times
Looks like a duplicate of #22
Please avoid duplicates
Language and Compiler
Babel and WebPack JavaScript
What environment are you using?
Static File Serving
When does your problem occur?
When the Unity Component unmounts
What does your problem relate to?
The problem seems Module related
React-Unity-WebGL Version
9.5.2
React Version
18.2.0
Unity Version
2022.3.19f1
What happened?
https://github.com/jeffreylanters/react-unity-webgl/assets/58468458/cb51b3ec-690a-4525-ac0e-b9faee06ca1b https://github.com/jeffreylanters/react-unity-webgl/assets/58468458/d63f37e1-0b22-42a1-984d-623ce6a4fc98 I have a multi-page React application, and I created a page specifically for launching all the games I have. The problem is that when I open any game, Unity gets allocated in memory. When I navigate to another page and then open the same game or any other game, a new memory slot gets allocated each time, eventually leading to lags or Unity crashing due to memory issues. I tried using the unload method, and while the logs indicate it's working, I don't see any actual memory being freed. I've resorted to reloading the page to free up memory, but is there another solution?
Reproducible test case
Just create multipage app and try to open game few times
Would you be interested in contributing a fix?