When using the AddDynamic macro of a dynamic delegate, line breaks can cause the function name to be incorrectly parsed.
For instance:
[FONT=courier new]delegate->AddDynamic(this, &UMyClass::MyFunction)
works fine.
However,
[FONT=courier new]delegate->AddDynamic(this, &UMyClass::
MyFunction)
fails.
In the second case, the AddDynamic macro expansion retains the space between the :: and MyFunction, i.e. the macro sees the function as “&UMyClass:: MyFunction”. Eventually this is passed to GetTrimmedMemberFunctionName, which retains everything after the :: as the function name, including the extra space, i.e. " MyFunction" in this case.
The easiest fix would be to trim leading spaces in the function name when removing the “<Class>::” prefix.