You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that Zenject somehow is "leaking" in memory. Any instances that has bound to a SceneContext are kept in memory even when the scene has been unloaded. Any help to solve this issue (or find a workaround for it) would be appreciated!
Steps to reproduce:
I create an Empty Scene with only one gameobject that has below components.
Loader script to load other scene
SceneContext with default value
ZenjectBinding with the loader script in its components
Then, i've another scene with button to load the empty scene and some default unity gameobjects. This scene is only generating some prefab instance with zenject. Only one gameobject that should be notice from this scene. That gameobject contains below components.
Script that instantiate the prefab to many
SceneContext with ScriptableObject Installers for storing the prefab and MonoInstaller for Binding the classes.
ZenjectBinding with the previous "instantiator script"
Then i just going back from empty scene to that another scene and go to empty scene again and to that another scene again for a few times, it always create a new instance and never GC the previous object, so the previous is always stay in memory.
I've check the memory profiler, that the "leaking" object's count is as much as how much i load the non-empty scene.
I've check the solution from here: #654. But, it still not solved and the project link is dead, so i can't also compare to mine.
The text was updated successfully, but these errors were encountered:
sapiscow
changed the title
Object that has Reference to the SceneContext stay in memory after scene unloaded
[Bug] Object that has Reference to the SceneContext stay in memory after scene unloaded
Sep 1, 2024
Hello!
I've found that Zenject somehow is "leaking" in memory. Any instances that has bound to a SceneContext are kept in memory even when the scene has been unloaded. Any help to solve this issue (or find a workaround for it) would be appreciated!
Steps to reproduce:
I've check the solution from here: #654. But, it still not solved and the project link is dead, so i can't also compare to mine.
The text was updated successfully, but these errors were encountered: