FDeferredObjInitializationHelper::DeferObjectPreload

Determines if the specified object should have its Preload() skipped.

Windows
MacOS
Linux

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/Blueprint/BlueprintSupport.h

Include

#include "Blueprint/BlueprintSupport.h"

Source

/Engine/Source/Runtime/CoreUObject/Private/Blueprint/BlueprintSupport.cpp

Syntax

static bool DeferObjectPreload
(
    UObject * Object
)

Remarks

Determines if the specified object should have its Preload() skipped. If so, this should cache the sub-object so it can be loaded later, when its dependency is resolved.

Designed to be called from the Preload() itself (before it runs serializes the object).

More info: Because of delta serialization, we require that a parent's CDO be fully serialized before its children's CDOs are created. However, due to cyclic parent/child dependencies, we have some cases where the linker breaks that expected behavior. In those cases, we defer the child's initialization (i.e. defer copying of parent property values, etc.), and wait until we can guarantee that the parent CDO has been fully loaded.

In a normal scenario, the order of property initialization is: Creation (zeroed) -> Initialization (copied super's values) -> Serialization (overridden values loaded) When the initialization has been deferred we have to make sure to defer serialization here as well (don't worry, it will be invoked again from FinalizeBlueprint()->ResolveDeferredExports())

also, if this is an inherited sub-object on a CDO, and that CDO has had its initialization deferred (for reasons explained above), then we shouldn't serialize in data for this quite yet... not until its owner has had a chaTnce to initialize itself (because, as part of CDO initialization, inherited sub-objects get filled in with values inherited from the super)

Returns

True if the object's Preload() should be skipped.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss