void SDetailsView::RemoveInvalidObjects()
{
	TArray< TWeakObjectPtr< UObject > > ResetArray;

	bool bAllFound = true;
	
	for(const TSharedPtr<FComplexPropertyNode>& ComplexRootNode : RootPropertyNodes)
	{
		FObjectPropertyNode* RootPropertyNode = ComplexRootNode->AsObjectNode();
		if(RootPropertyNode)
		{
			for(TPropObjectIterator Itor(RootPropertyNode->ObjectIterator()); Itor; ++Itor)
			{
				TWeakObjectPtr<UObject> Object = *Itor;

				if(Object.IsValid() && !Object->IsPendingKill())
				{
					ResetArray.Add(Object);
				}
				else
				{
					bAllFound = false;
				}
			}
		}
	}

	if (!bAllFound)
	{
		SetObjectArrayPrivate(ResetArray);
	}
}
Beispiel #2
0
void SDetailsView::RemoveInvalidObjects()
{
	TArray< TWeakObjectPtr< UObject > > ResetArray;

	bool bAllFound = true;
	for (TPropObjectIterator Itor(RootPropertyNode->ObjectIterator()); Itor; ++Itor)
	{
		TWeakObjectPtr<UObject> Object = *Itor;

		if( Object.IsValid() && !Object->IsPendingKill() )
		{
			ResetArray.Add(Object);
		}
		else
		{
			bAllFound = false;
		}
	}

	if (!bAllFound)
	{
		SetObjectArrayPrivate(ResetArray);
	}
}