Runtime deleting components crash because of names
I'm right now developing an actor class that, when spawned in the editor creates a bunch of components name "Component_X" attached to itself, being X its index. The property that indicates how many of these components are to be created can be changed in the editor using the UPROPERTY stuff.
When the number is changed to a lower one, the components are deleted using:
This works fine, the components disappear both in the screen and in the actor's details.
Problem comes when the number is changed to a higher one BEFORE it was changed to a lower one. Unreal Editor crashes and I'm pretty sure it's because of the names. I debugged this: I change the number to a lower one (and thus, destroy some of the components), then if I try to manually create through the editor a component with the name "Component_X", being X the number of a component that existed before deleting, it says that there's already a component with that name.
That makes me think that something is not working during the destruction. Is it a garbage collector trouble?
asked Feb 28 '16 at 10:23 PM in C++ Programming
Follow this question
Once you sign in you will be able to subscribe for any updates here