How to destroy UMG widget?

I have several Widgets that are part of a bigger widget and the data is dynamic, and the number of Widgets is also dynamic. I don’t want to have to store an array of Widget references and then iterate through each one to reconstruct the UI, and add a new widget to the list of references if there are not currently enough Widgets. For me, it’s not about the performance overhead, the difference in construct time would be so minuscule.

Keeping unused Widgets in memory also has a side effect on certain operations, such as retrieving all Widgets of a class, and if I know that I can optimize that call by culling Widgets that I know won’t be used, I should be able to do that.

I want to be able to manage the memory in a way that I want that fits in with my design pipeline, and I don’t see why I shouldn’t be allowed to explicitly destroy an Object if I feel like that’s best for my applications.

1 Like