How to reproduce:
-
Create a class (let’s say ATestActor).
-
Define some function that will be called as delegate function.
-
Add UFUNCTION attribute.
-
Set your delegate function using AddDynamic to some component ( I was using UStaticMeshComponent.OnComponentBeginOverlap) in your class constructor.
-
Create a Blueprint Class (let’s say BP_TestActor).
-
Instantiate an object of BP_TestActor.
-
Make sure that your delegate function is being called properly.
-
Comment out code, that sets delegate, and recompile.
-
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.