UE56 Editor lauched with -AsyncLoadingThread will trigger MTAccess

Hi,

When launching the editor with the -AsyncLoadingThread flag, the engine uses an asynchronous thread to load and instantiate UObjects.

At this point, if the instantiated UObject contains an FDataflowInstance property, such as in UGeometryCollection, the constructor of FDataflowInstance will call:

FCoreUObjectDelegates::OnObjectPropertyChanged.AddRaw.

The AsyncLoadingThread then needs to perform AcquireWriteAccess for FCoreUObjectDelegates::OnObjectPropertyChanged. If, at the same time, the GameThread calls FCoreUObjectDelegates::OnObjectPropertyChanged.Broadcast, it will also attempt AcquireWriteAccess.

This eventually triggers the ensure error.

Is this a known issue? Are there any related fixes or commits?

Thanks

FDataflowInstance::FDataflowInstance(UObject* InOwner, UDataflow* InDataflowAsset, FName InTerminalNodeName)
	: DataflowAsset(InDataflowAsset)
	, DataflowTerminal(InTerminalNodeName)
	, VariableOverrides(this)
	, Owner(InOwner)
{
#if WITH_EDITOR
	// let listen to property change on the owner so we can listen to our own changes ( because we are a struct )
	if (Owner)
	{
		FDataflowAssetDelegates::OnVariablesChanged.AddWeakLambda(Owner.Get(), 
			[this](const UDataflow* InDataflowAsset, FName InVariableName)
			{
				if (InDataflowAsset == DataflowAsset)
				{
					VariableOverrides.OnDataflowVariablesChanged(InDataflowAsset, InVariableName);
				}
			});
		OnOwnerPropertyChangedHandle = FCoreUObjectDelegates::OnObjectPropertyChanged.AddRaw(this, &FDataflowInstance::OnOwnerPostEditChangeProperty);
	}
#endif
}

Hello!

The AsyncLoadingThread was not ready to be used in version 5.6. We did fix a lot of problems in version 5.7 but this one is new. I filled an internal bug report so this can get addressed. You should be able to follow its resolution here: https://issues.unrealengine.com/issue/UE-357499

Thanks for the detailed report!

Martin