Removing UPROPERTY TArray with content causes memory leak

Hi, I have discovered a bug where if you remove an UPROPERTY TArray with content in C++ without manually clearing the content in editor will cause memory leak where the content of TArray will stay referenced by owner.

Steps to reproduce:

  1. Make a UPROPERTY(EditDefaultsOnly) TArray>
  2. Go into editor and fill up the array with actor BPs
  3. Go back to source code editor and remove the TArray
  4. Go back to owner of the removed TArray and use reference viewer
  5. Reference viewer will show the owner of the removed TArray referencing the content of the TArray even though the TArray is removed in C++. Hence, memory leak.

Expected outcome:
After the removal of the TArray, the owner of TArray should clear all the referencs to the content of TArray.

Found the solution Unreal Slackers.
Just need to resave the BP and restart editor.