[Widget Delegate]How to remove binding when a widget remove from parent

Delegate still fires when the widget ‘Remove from parent’.
Is there any way to unbind event?

Is it better to use the blueprint interface instead of binding events?
In fact, the blueprint interface is also triggered when it remove from parent, but the blueprint interface can be removed manually.

  • call unbind on the widget, that should be it
  • interface and dispatchers are 2 different methods of communication; whether one is better than the other is situational
  • when you create a widget and reference it via a reference variable, Remove from Parent will not destroy it. You’d need to remove it from parent, dereference it and wait for the Garbage Collection to swoop in and get rid of it. Or ask the GC to do its job out of schedule, which can be somewhat costly.

The real question here is:

  • do you want to get rid of the widget and release memory?
  • do you want the widget to hang around for later use but not listen?

Found it!
Thanks a lot!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.