I have a strange problem since I ported my project to 4.8:
Everything works fine until I press ‘Stop Play’ after playing in editor. At that point the editor crashes with the following error message:
[2015.06.17-18.40.25:611][308]LogWindows: === Critical error: ===
Fatal error: [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.8\Engine\Source\Runtime\CoreUObject\Private\UObject\ReferenceChainSearch.cpp] [Line: 633]
Unknown token
I did some experimenting and found out that I can prevent the crash by not declaring a TArray as UPROPERTY in a certain UClass. The structure is the following:
In the GameState I create a custom UClass responsible for keeping track of who is targeting who. The Gamestate.cpp looks like this:
ACGameState::ACGameState(const class FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
targetManager = NewObject<UCTargetManager>(UCTargetManager::StaticClass(), "TargetManager");
}
The relevant part of the TargetManager.cpp looks like this: (I omitted a lot of code but I made sure this is all code that is actually called during the testing.)
int UCTargetManager::RegisterObject(ACSpaceObject* newObject)
{
int newID = counter;
counter += 1;
KnownObjects.Add(newObject);
return newID;
}
The corresponding TargetManager.h file looks like this: (Again, all non relevant parts are omitted.)
UCLASS()
class UNREAL_SPACE_API UCTargetManager : public UObject
{
GENERATED_BODY()
private:
UPROPERTY()
int32 counter = 0;
//Array holding all known objects.
UPROPERTY()
TArray<ACSpaceObject*> KnownObjects;
}
Every ACSpaceObject calls the TargetManager’s RegisterObject method in the BeginPlay method.
Running the project like this causes the crash as soon as I press ‘Stop Play’. If I remove the last UPROPERTY() statement from the TargetManager.h file everything works fine.
Is this some kind of bug or am I doing something wrong.
I attached the last log file and the corresponding dump.
link text