Download

Fatal error on ProcessMulticastDelegate

Hello :slight_smile:

so I got this log:

[2017.03.29-17.52.56:694][905]LogWindows:Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff
[2017.03.29-17.52.56:694][905]LogWindows:Error:
[2017.03.29-17.52.56:694][905]LogWindows:Error: UE4Editor-SurvivalGame.dll!TMulticastScriptDelegate<FWeakObjectPtr>::ProcessMulticastDelegate<UObject>() [d:\unrealengine-4.15.0-release\engine\source\runtime\core\public\uobject\scriptdelegates.h:457]
[2017.03.29-17.52.56:694][905]LogWindows:Error: UE4Editor-SurvivalGame.dll!ASPickupActor::execOnRep_ParentAssociateItem() [d:\qanganew\source\survivalgame\public\items\spickupactor.h:11]
[2017.03.29-17.52.56:694][905]LogWindows:Error: UE4Editor-CoreUObject.dll!UFunction::Invoke() [d:\unrealengine-4.15.0-release\engine\source\runtime\coreuobject\private\uobject\class.cpp:4525]
[2017.03.29-17.52.56:694][905]LogWindows:Error: UE4Editor-CoreUObject.dll!UObject::ProcessEvent() [d:\unrealengine-4.15.0-release\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1318]

In my SPickupActor.h i got this declaration:



UFUNCTION()
void OnRep_ParentAssociateItem(ASPickupActor* parentAssociateItem_P);

UPROPERTY(Transient, ReplicatedUsing = OnRep_ParentAssociateItem)
ASPickupActor* parentAssociateItem;


In my .cpp I got this:



void ASPickupActor::OnRep_ParentAssociateItem(ASPickupActor* parentAssociateItem_P)
{
	if (GetOwner()) {
		ASCharacter* player_P = (ASCharacter*)GetOwner();
		if (player_P) {
			player_P->onUpdateListAccessoire.Broadcast();
		}
	}
}

...

void ASPickupActor::GetLifetimeReplicatedProps(TArray<FLifetimeProperty> & OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);
        DOREPLIFETIME(ASPickupActor, parentAssociateItem);
}


What i want to do is update an interface of accessory when his parent change and is replicated to client by broadcasting the event onUpdateListAccessoire which is declared in my Character, but randomly i got this error… I really don’t know why…