Download

CameraComponent->TransformUpdated.AddThreadSafeSP causes crash

Hi,

I’m using the delegate provided by USceneComponent “TransformUpdated” in order to retrieve update events fired by a UCameraComponent.
I’m retrieving the camera component already created, then I’m creating a TSharedRef for storing the link to the calling instance.

Then I call for AddThreadSafeSP, and the crash starts.


TSharedRef<UMultipleCamSpringArmComponent, ESPMode::ThreadSafe> sharedPtr = TSharedRef<UMultipleCamSpringArmComponent, ESPMode::ThreadSafe>(this);
ChildCamera->TransformUpdated.AddThreadSafeSP(sharedPtr, &OnChildCameraTransformUpdateHandle);


void UMultipleCamSpringArmComponent::OnChildCameraTransformUpdateHandle(USceneComponent* camera, EUpdateTransformFlags flags, ETeleportType teleportType ) {
	UE_LOG(LogTemp, Log, TEXT("yeee callback"));
}

Does anybody know why?