drskullster Posted July 18, 2018 Share Posted July 18, 2018 Hi, I'm using pixijs in a one-page app. I would like to clean up pixijs references when user changes route, but still be able to reinstantiate it if user comes back. I've seen some posts about pixijs cleanup but either : - I only remove stage children and my memory consumption keeps going up each time I reinstantiate a PIXI.Application - I use `app.destroy()` but after a new PIXI.Application `app.renderer` is undefined - I use `app.stage.destroy()` and `app.renderer.destroy()` and I have an issue with Textures Any idea on the best way to achieve this ? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 18, 2018 Share Posted July 18, 2018 did you look at lingering objects in heap? May be something like "app.loader.reset()" or "PIXI.utils.destroyTextureCache()" is missing we have no guides on how to do that => its your job to find it and make an article. Welcome to open-source. Quote Link to comment Share on other sites More sharing options...
drskullster Posted July 19, 2018 Author Share Posted July 19, 2018 14 hours ago, ivan.popelyshev said: did you look at lingering objects in heap? May be something like "app.loader.reset()" or "PIXI.utils.destroyTextureCache()" is missing we have no guides on how to do that => its your job to find it and make an article. Welcome to open-source. Thanks for your answer. If I destroy the textures and reset the loader, I'm not able to re-instantiate the app, I get an error when pixi is trying to get textures. I guess my question is: is it possible ? Does Pixi handle this particular case of re-instantiating an app after destroy ? I'd be happy to add stuff to the github wiki pages if I manage to do that properly. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 19, 2018 Share Posted July 19, 2018 just `app.destroy()` has to work. however you've said it doesnt Quote Link to comment Share on other sites More sharing options...
drskullster Posted July 19, 2018 Author Share Posted July 19, 2018 Indeed it does seem to work : https://codepen.io/anon/pen/yqaZaJ I'll have a closer look at my code Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.