- تم التحرير
Memomry Leak with SkeletonGraphic(UI)
We have a memory problem. In our game, We use many SkeletonGraphics. It is saved in prefab(contain SkeletonGraphic component). when we clone it and then destroy it. Memory and Mesh will be increased. The code like this:
var clone = GameObject.Instantiate(prefab);
GameObject.Destroy(clone);
It is simple but Memory and Mesh will be increased.
We are very confused. Am I use the correct way to create and destroy it?
Thank you for your reading.
Please give me some suggestions to use SkeletonGraphic.
Maybe it must be created same as the example with new SkeletonGraphic?
Thanks for reporting and sorry for the troubles!
I've created an issue ticket here:
https://github.com/EsotericSoftware/spine-runtimes/issues/1887
I assume you have Advanced - Multiple Canvas Renderers
enabled on some of the SkeletonGraphic
objects, is this correct?
Thank you for your reply quickly.
Yes, i use that config. Can i override OnDestroy method in SkeletonGraphic and call Clear method?
This will most likely be the bugfix that we will also commit to resolve this issue. It might just take us until monday to fix the issue, check for potential related issues, perform testing and release a new unitypackage. So if you don't want to wait, feel free to implement the bugfix yourself as described above in the meantime.
Edit: While implementing the bugfix, we just discovered that there was another bug preventing the fix from working immediately. We have now properly fixed the issue and committed the fix to both the 3.8 and 4.0-beta branches.
New unitypackages are available for download here as usual:
Spine Unity Download
Please let us know if this fixes the issue for you as well. Thanks again for reporting!