x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Events binded in widget do not unbind on Destruct

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.

Product Version: UE 4.16
Tags:
more ▼

asked Jul 23 '17 at 02:28 PM in Bug Reports

avatar image

Skylonxe
81 4 5 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hello Skylonxe!

Yes you have to, you must unbind all events. It is absolutely recommended and unreal provided you whit the "unbind all events node" to easy this process.

You cannot be sure an object gets garbage collected if event are still binded. https://answers.unrealengine.com/questions/647140/is-it-necessary-to-unbind-events-before-destroying.html

more ▼

answered Jul 23 '17 at 08:57 PM

avatar image

AZTECCO
1k 17 8 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question