Actor gets garbage collected when saved in UPROPERTY Tarray

Hello Everyone …

i actually don´t know if i am doing something wrong or this is just a weird bug.
But when i try to spawn an actor and afterwards try to save it in an array it just does not spawn.

Here the code:

UPROPERTY( BlueprintReadWrite, Category = Test)
		TArray<Voxel*> VoxelList;

Voxel* SpawnedVoxel=
GetWorld()->SpawnActor<Voxel>(VoxelToSpawn, SpawnLocation, FRotator());
if (SpawnedVoxel)
      GEngine->AddOnScreenDebugMessage(-1, 30, FColor::Orange, SpawnedVoxel->GetName());
}else {
	     GEngine->AddOnScreenDebugMessage(-1, 30, FColor::Orange, TEXT("not spawning"));
//	VoxelList.Add(SpawnedVoxel);

So the voxel gets spawned if i dont use

Am i doing something wrong here?



prevents the actor from beeing spawned…

i couldnt reproduce this in a new projcet…
and for some reason after retyping the code it works now.