SpaceToast Posted November 2, 2018 Share Posted November 2, 2018 I've been working on an open world project that involves a lot of loading and unloading of assets. (A virtual museum of Earth history.) SceneLoader.LoadAssetContainerAsync() seems to be the only means of tracking which and when new assets have been loaded, as SceneLoader.LoadAsync() returns only the current scene. Where I'm running into trouble is the end of the life cycle. AssetContainer does not have a dispose() method. My attempts to manually create one have thus far ended in halt & catching fire. The removeAllFromScene() method will dispose of the assets* but I'm still left with an AssetContainer object from every SceneLoader call. If I clear the assets in a different way, the assets won't garbage collect, because the AssetContainer itself still references them. Has anyone worked on a similar scenario? How did you manage large volumes of load -> use -> forget? *AssetContainer.removeAllFromScene() seems to have a problem removing instanced objects, but I've been too lazy to create a proper bug report. I promise I will! Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 2, 2018 Share Posted November 2, 2018 @SpaceToast Sounds like a missing feature. I can add this, I guess I've always manually disposed when working with pretty simplistic assets. Yes please do create a bug for your issue if you have a good repo and I can look at that as well. Created this to track the dispose: https://github.com/BabylonJS/Babylon.js/issues/5456 Quote Link to comment Share on other sites More sharing options...
Guest Posted November 5, 2018 Share Posted November 5, 2018 Flagging as solved Thanks @trevordev 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.