The more I learn about PDA and AssetManager, the faster I go crazy.
Today I encountered a new problem: object (Primary Data Asset ) is not unloaded from memory.
I run ForceGC and check obj list class=ItemAssetData
and I still have all the loaded PDAs, even though no one has references to them
You’d think after loading it should unload the asset, but it doesn’t.
When I use the obj refs name=PDA_Wood command to see the references, I get this message: PDA_Wood is not currently reachable but it does have some of GARBAGE_COLLECTION_KEEPFLAGS set.
But as soon as I added the line Asset->Asset->ClearFlags(RF_Standalone) everything worked.
Are you testing this in the Editor or in a packaged build?
You shouldn’t have to clear the Standalone flag to make this work. But you also can’t do this sort of testing in the Editor because it does all sort of things to preload and keep loaded certain assets based on what you might be working on. If the only reason it’s still loaded is the Standalone flag, it sounds like you’re doing this in Editor and if that’s the only reason it’s loaded you’re fine. Just don’t clear it as part of your own implementation.
Thank you very much, and indeed it was because of testing in the Editor (I couldn’t even think that it was because of this)))).
It’s good that I understood why, but how much time I wasted… eh… okay