c++ destroy UStaticMesh?
If I need to remove a UStaticMesh from my component, do I NEED to mark it for destruction? Or can I just remove it from my component and leave it for the garbage collector to deal with?
For instance should I do (A):
Or should I just do (B):
I ask because A seams to crash super frequently, as well as giving me "Failed to Load Asset" errors.
B SEEMS to remove the static mesh as I'd like it to? But I haven't found concrete information telling me it's not still floating around un-cleaned-up.
asked Jul 29 '15 at 04:18 AM in C++ Programming
With the A method, the Static mesh will be destroyed, and maybe you're setting the mesh when it doesn't exist, so the editor crashes because it can't load the asset. The B method should work fine. If you want to destroy the component, use:
But you can't use it after it's destroyed!
Follow this question
Once you sign in you will be able to subscribe for any updates here