[BUG] Delegate in Blueprint Class keeps being called even after removing code to set delegate

How to reproduce:

  1. Create a class (let’s say ATestActor).

  2. Define some function that will be called as delegate function.

  3. Add UFUNCTION attribute.

  4. Set your delegate function using AddDynamic to some component ( I was using UStaticMeshComponent.OnComponentBeginOverlap) in your class constructor.

  5. Create a Blueprint Class (let’s say BP_TestActor).

  6. Instantiate an object of BP_TestActor.

  7. Make sure that your delegate function is being called properly.

  8. Comment out code, that sets delegate, and recompile.

  9. Your delegate function is still called.

If you open BP_TestActor.uasset, you may see that it still contains function name.

I can provide project source files to reproduce this issue.
Similar issue (I guess root cause is the same): here

Engine version is 4.19, but I guess it can be reproduced on 4.18 as well, because similar issue, linked above, was reported 2 years ago.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form

Thanks

Hi Jeff. Done. Thanks!