Events binded in widget do not unbind on Destruct

Skylonxe
Sun, 23 Jul 2017 14:28:54 +0000
UI

I run into very weird issue. I have an actor with event dispatcher and widget blueprint placed in main menu which binds event to this event dispatcher during Construct. When widget is destructed (I open another scene) and then I open main menu second time, my event is binded to actor’s event dispatcher in Construct second time. So calling event dispatcher in actor makes widget event fire twice (or atleast it prints log 2 times, maybe it is not from same widget, it can be from some other one which is waiting for garbage collection).

I was expecting that all events are automatically unbind during destruct of widget. What is even more confusing, I tried to fix it with Do Once node placed before Bind Event in Construct. It did not fixed it because Do Once gets reset when widget is destructed (of course, because it is probably completly different object).

Only possible solution is to manually Unbind event in Deconstruct.

2 posts - 1 participant