@@ -106,7 +106,7 @@ void UFlowAsset::PostLoad()
106106EDataValidationResult UFlowAsset::ValidateAsset (FFlowMessageLog& MessageLog)
107107{
108108 // validate nodes
109- for (const TPair<FGuid, UFlowNode*>& Node : Nodes)
109+ for (const TPair<FGuid, UFlowNode*>& Node : ObjectPtrDecay ( Nodes) )
110110 {
111111 if (IsValid (Node.Value ))
112112 {
@@ -329,7 +329,7 @@ void UFlowAsset::HarvestNodeConnections()
329329 }
330330 }
331331
332- for (const TPair<FGuid, UFlowNode*>& Pair : Nodes)
332+ for (const TPair<FGuid, UFlowNode*>& Pair : ObjectPtrDecay ( Nodes) )
333333 {
334334 UFlowNode* FlowNode = Pair.Value ;
335335 TMap<FName, FConnectedPin> FoundConnections;
@@ -878,7 +878,7 @@ UFlowNode* UFlowAsset::GetDefaultEntryNode() const
878878{
879879 UFlowNode* FirstStartNode = nullptr ;
880880
881- for (const TPair<FGuid, UFlowNode*>& Node : Nodes)
881+ for (const TPair<FGuid, UFlowNode*>& Node : ObjectPtrDecay ( Nodes) )
882882 {
883883 if (UFlowNode_Start* StartNode = Cast<UFlowNode_Start>(Node.Value ))
884884 {
@@ -946,7 +946,7 @@ UFlowNode_CustomInput* UFlowAsset::TryFindCustomInputNodeByEventName(const FName
946946
947947UFlowNode_CustomOutput* UFlowAsset::TryFindCustomOutputNodeByEventName (const FName& EventName) const
948948{
949- for (const TPair<FGuid, UFlowNode*>& Node : Nodes)
949+ for (const TPair<FGuid, UFlowNode*>& Node : ObjectPtrDecay ( Nodes) )
950950 {
951951 if (UFlowNode_CustomOutput* CustomOutput = Cast<UFlowNode_CustomOutput>(Node.Value ))
952952 {
@@ -966,7 +966,7 @@ TArray<FName> UFlowAsset::GatherCustomInputNodeEventNames() const
966966 // from the actual flow nodes
967967 TArray<FName> Results;
968968
969- for (const TPair<FGuid, UFlowNode*>& Node : Nodes)
969+ for (const TPair<FGuid, UFlowNode*>& Node : ObjectPtrDecay ( Nodes) )
970970 {
971971 if (UFlowNode_CustomInput* CustomInput = Cast<UFlowNode_CustomInput>(Node.Value ))
972972 {
@@ -983,7 +983,7 @@ TArray<FName> UFlowAsset::GatherCustomOutputNodeEventNames() const
983983 // from the actual flow nodes
984984 TArray<FName> Results;
985985
986- for (const TPair<FGuid, UFlowNode*>& Node : Nodes)
986+ for (const TPair<FGuid, UFlowNode*>& Node : ObjectPtrDecay ( Nodes) )
987987 {
988988 if (UFlowNode_CustomOutput* CustomOutput = Cast<UFlowNode_CustomOutput>(Node.Value ))
989989 {
@@ -1099,7 +1099,7 @@ void UFlowAsset::InitializeInstance(const TWeakObjectPtr<UObject> InOwner, UFlow
10991099 Owner = InOwner;
11001100 TemplateAsset = InTemplateAsset;
11011101
1102- for (TPair<FGuid, UFlowNode* >& Node : Nodes)
1102+ for (TPair<FGuid, TObjectPtr< UFlowNode> >& Node : Nodes)
11031103 {
11041104 UFlowNode* NewNodeInstance = NewObject<UFlowNode>(this , Node.Value ->GetClass (), NAME_None, RF_Transient, Node.Value , false , nullptr );
11051105 Node.Value = NewNodeInstance;
@@ -1118,7 +1118,7 @@ void UFlowAsset::InitializeInstance(const TWeakObjectPtr<UObject> InOwner, UFlow
11181118
11191119void UFlowAsset::DeinitializeInstance ()
11201120{
1121- for (const TPair<FGuid, UFlowNode*>& Node : Nodes)
1121+ for (const TPair<FGuid, UFlowNode*>& Node : ObjectPtrDecay ( Nodes) )
11221122 {
11231123 if (IsValid (Node.Value ))
11241124 {
0 commit comments