Closed JB-Scott closed 5 years ago
I believe that the v5 code would be yourRenderer.plugins.batch._batchedElements.length = 0;
. Looking at BatchRenderer
, it is probably still needed, but you shouldn't need to do it much. I would only do it when unloading a level or something similar, when you want to deep clean everything in preparation for what comes next.
Nevermind, no longer needed for V5.
Thanks for confirming it is no longer needed.
There is the following note in the documentation:
"When using PixiJS 3+, the SpriteRenderer in WebGL may keep a reference to your particles after you have destroyed your emitter. To ensure that they are garbage collected, in WebGL only, reset the SpriteRenderer's sprite batching with yourRenderer.plugins.sprite.sprites.length = 0;"
It seems that the changes to the way rendering is done in PIXI v5 mean this code is no longer possible. Is there still a need to do the same sort of thing in PIXI v5? If so, what is the appropriate code to call?