Why do invoke MarkPendingKill() in PostLoad() of UEnvQueryManager class.

This line of code will cause UEnvQueryManager CDO was destroyed and garbage collected, but for what reason of invoking MarkPendingKill() method here?

We will receive an error message like below:

15:27:47.432|3450|54.307|54.307|F|LogGarbage|Invalid object in GC: 0xb400006e360f59a0, ReferencingObject: BP_XAISystem_C /Game/Maps/Lobby/Lobby.Lobby:BP_XAISystem_C_2147481930, ReferencingObjectClass: BlueprintGeneratedClass /Game/Battle/AI/BP_XAISystem.BP_XAISystem_C, Property Name: EnvironmentQueryManager, Offset: 176, TokenIndex: 3

@Marc_Audy

iirc postload is only called when an actor is placed on the level and the game is run.

so maybe it’s meant to capture when you place a manager manually. since probably it gets spawned dynamically.

thats just speculation though.