My delegate callback that wasn’t having any issues in prior UE versions, is crashing in UE 5.2.1 (was also crashing in 5.2).
Here’s the context:
- There is a “Level Challenge Activator” class that derives from a “Challenge Activator interface” class.
UCLASS()
class SPHERESLAPPER_API ULevelChallengeActivator final : public UChallengeActivator_I
- That ChallengeActivator interface class implements an ‘onActivationEvent’ callback for a Multicast delegate, and a virtual ‘processActivationEvent’ function that child class implementations are expected to implement.
UCLASS()
class SPHERESLAPPER_API UChallengeActivator_I : public UObject
{
// ...
protected:
UFUNCTION()
void onActivationEvent(UBundle* eventArgs);
virtual void processActivationEvent(UBundle* eventArgs);
- Here’s the code for how that works:
void UChallengeActivator_I::onActivationEvent(UBundle* eventArgs) {
if (EventUtils::EventParamsMatch(mActivationEventParams, eventArgs)) {
processActivationEvent(eventArgs);
}
}
void ULevelChallengeActivator::processActivationEvent(UBundle* eventArgs) {
// do stuff
}
What started happening in UE 5.2:
-
The LevelChallengeActivator’s processActivationEvent gets called and processed.
-
Upon LevelChallengeActivator.processActivationEvent completing, I get an ‘Access Violation Reading Location’ exception in the following engine stack function (line that is excepting is bolded):
FORCEINLINE_DEBUGGABLE void FFrame::StepCompiledIn(void* Result, const FFieldClass* ExpectedPropertyType)
{
if (Code)
{
Step(Object, Result);
}
else
{
checkSlow(ExpectedPropertyType && ExpectedPropertyType->IsChildOf(FProperty::StaticClass()));
checkSlow(PropertyChainForCompiledIn && PropertyChainForCompiledIn->IsA(ExpectedPropertyType));
FProperty* Property = (FProperty*)PropertyChainForCompiledIn;
PropertyChainForCompiledIn = Property->Next;
**StepExplicitProperty(Result, Property);**
}
}
If anyone has any insight into why this is happening and/or why it started happening in UE 5.2, that would be great! Thanks in advance!