Destroy widget/garbage collection

I know this question was asked too many times to count, but the “latest” discussions about the topic I’ve found are about two years old, with many engine updates in between so, my questions are:

  1. How to destroy widgets in order to avoid memory leaks;
  2. Is garbage collection handling widgets when removed from parent and if it does, how often does it destroy them - is it a timer/based on a certain memory threshold/or a certain number of widgets?

Thanks!

The latest discussion on this was actually earlier this month. Here is the link to that question.

The post is old, but the 2 comments are from May and I also provide a link in that comment to a VERY in depth discussion I and 2 others had on this topic back in February of 2019. That link is here:

Long story short: if you want to remove the widgets from memory you must manually call “collect garbage”. Otherwise they stay in memory for the duration of the level.

This is a link to a thread where we figured it out. It is a bit heavy though so don’t wanna spam that command.

Haha, yea, I posted the link above :slight_smile:

Thank you for your answers, yea, I’ve read the discussions on manually calling garbage collection (and it’s downsides). I just thought things have changed meanwhile and the - what I consider to be - issue has been “solved”.

Thx for the hlp tho :slight_smile: