Hi,
I have a specific setup where an overview widget with 3 tabs dynamically creates widgets and adds them as a child to a vertical box inside the overview. Each tab contains a list of exercises (each exercise is generated as a widget with custom content and markup). Whenever I switch a tab, I clean up the vertical box and create a new list of exercises. However, constantly switching between these 3 tabs, causes many (old) widget instances to stay behind. I tried the “remove from parent” node but it doesn’t remove them from memory. There is also no proper way in UE4 to destroy a widget reference as you can do with an actor. I could reuse the created widgets again but they are dynamically generated and can have their status changed every time so then I would use bindings/ticks to update their content which is not good for performance.
I found a easy solution to remove all these unused instances that were created using a node called “garbage collect” whenever I want to clean up all old widgets and recreate only the widgets from an active tab still in memory. However, are there any risks involved using this node? I understand the principe of garbage collection but have no experience actively using it in UE4. Not sure if things may break elsewhere, when this node is called.