We’re seeing some log warnings about AccessViolation in property accessors not finding valid components or component data fields. These happen consistently in the preview port, but do not seem to be affecting our PIE runs.
We have component pointers on our AActor derived types and our UActorComponent derived types.
UPROPERTY(BlueprintReadOnly, Transient)
TObjectPtr<UGameTypeComponent> GameTypeComponent;
For the AActor derived type, we noticed that we need to re-initialize our pointers in the ReregisterAllComponents() overridden function, as they may have been unregistered and new ones registered.
For the UActorComponent derived type, when the component is unregistered and a new one registered the InitializeComponent function is not called, so our initialization of those pointers needed to move to our OnRegister() override.
Is this the correct pattern to use, or is there another pattern we should be using?