Reference to self causes warning when deleting

Actors with a reference to self will cause this warning when deleting it in the editor:

221804-selfref.png

It says “is referenced by other Actors/Objects” but it is not. It is referenced by itself. Also throwing a warning for this makes no sense or at least should be possibly to disable. There is currently no UPROPERTY setting to disable this I believe.

// header
 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Turret01|IDamageable")
 FTargetInfo TargetInfo;

// cpp
 ATurret01::ATurret01()
 {
   TargetInfo = FTargetInfo(this, 1, true); // note the "this" keyword.
 }

For more info see: Okay to use "this" keyword in constructor/header? - C++ - Unreal Engine Forums

If the code allows it, the workaround would be to initialize self-references in the BeginPlay() instead of in the constructor. But that is not always desireable.

Hi Napoleonite,

Sorry for the delay in responding to your post. I ran some tests and was able to reproduce what you described. I have entered UE-57200 to have this investigated further.