Skip to content

Commit 2a19a1b

Browse files
authored
More TObjectPtr fixes (#243)
1 parent 46d7bad commit 2a19a1b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Source/Flow/Private/FlowSubsystem.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void UFlowSubsystem::StartRootFlow(UObject* Owner, UFlowAsset* FlowAsset, const
9898

9999
UFlowAsset* UFlowSubsystem::CreateRootFlow(UObject* Owner, UFlowAsset* FlowAsset, const bool bAllowMultipleInstances, const FString& NewInstanceName)
100100
{
101-
for (const TPair<UFlowAsset*, TWeakObjectPtr<UObject>>& RootInstance : RootInstances)
101+
for (const TPair<UFlowAsset*, TWeakObjectPtr<UObject>>& RootInstance : ObjectPtrDecay(RootInstances))
102102
{
103103
if (Owner == RootInstance.Value.Get() && FlowAsset == RootInstance.Key->GetTemplateAsset())
104104
{
@@ -271,7 +271,7 @@ void UFlowSubsystem::RemoveInstancedTemplate(UFlowAsset* Template)
271271
TMap<UObject*, UFlowAsset*> UFlowSubsystem::GetRootInstances() const
272272
{
273273
TMap<UObject*, UFlowAsset*> Result;
274-
for (const TPair<UFlowAsset*, TWeakObjectPtr<UObject>>& RootInstance : RootInstances)
274+
for (const TPair<UFlowAsset*, TWeakObjectPtr<UObject>>& RootInstance : ObjectPtrDecay(RootInstances))
275275
{
276276
Result.Emplace(RootInstance.Value.Get(), RootInstance.Key);
277277
}
@@ -281,7 +281,7 @@ TMap<UObject*, UFlowAsset*> UFlowSubsystem::GetRootInstances() const
281281
TSet<UFlowAsset*> UFlowSubsystem::GetRootInstancesByOwner(const UObject* Owner) const
282282
{
283283
TSet<UFlowAsset*> Result;
284-
for (const TPair<UFlowAsset*, TWeakObjectPtr<UObject>>& RootInstance : RootInstances)
284+
for (const TPair<UFlowAsset*, TWeakObjectPtr<UObject>>& RootInstance : ObjectPtrDecay(RootInstances))
285285
{
286286
if (Owner && RootInstance.Value == Owner)
287287
{
@@ -334,7 +334,7 @@ void UFlowSubsystem::OnGameSaved(UFlowSaveGame* SaveGame)
334334
}
335335

336336
// save Flow Graphs
337-
for (const TPair<UFlowAsset*, TWeakObjectPtr<UObject>>& RootInstance : RootInstances)
337+
for (const TPair<UFlowAsset*, TWeakObjectPtr<UObject>>& RootInstance : ObjectPtrDecay(RootInstances))
338338
{
339339
if (RootInstance.Key && RootInstance.Value.IsValid())
340340
{

Source/Flow/Private/Nodes/FlowNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ bool UFlowNode::FindConnectedNodeForPinSlow(const FName& PinName, FGuid* OutGuid
641641
return false;
642642
}
643643

644-
for (const TPair<FGuid, UFlowNode*>& Pair : FlowAsset->Nodes)
644+
for (const TPair<FGuid, UFlowNode*>& Pair : ObjectPtrDecay(FlowAsset->Nodes))
645645
{
646646
const FGuid& ConnectedFromGuid = Pair.Key;
647647
const UFlowNode* ConnectedFromFlowNode = Pair.Value;

Source/Flow/Private/Nodes/FlowPin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ bool FFlowPin::ValidateEnum(const UEnum& EnumType)
411411
const int64 Value = EnumType.GetValueByIndex(i);
412412
if (Value < std::numeric_limits<FDataType>::min() || Value > std::numeric_limits<FDataType>::max())
413413
{
414-
UE_LOG(LogFlow, Error, TEXT("'%s' value %d is outside the range of supported key values for enum [%d, %d].")
414+
UE_LOG(LogFlow, Error, TEXT("'%s' value %lld is outside the range of supported key values for enum [%d, %d].")
415415
, *EnumType.GenerateFullEnumName(*EnumType.GetDisplayNameTextByIndex(i).ToString())
416416
, Value, std::numeric_limits<FDataType>::min(), std::numeric_limits<FDataType>::max());
417417

0 commit comments

Comments
 (0)