# Does an owner of UPROPERTY member need to be also declared with UPROPERTY for garbage collector to work properly?

**URL:** <https://forums.unrealengine.com/t/does-an-owner-of-uproperty-member-need-to-be-also-declared-with-uproperty-for-garbage-collector-to-work-properly/1468196>\
**Category:** C++\
**Tags:** garbage-collector, uobject, unreal-engine, CPP\
**Created:** [December 4, 2023, 11:09am UTC](https://forums.unrealengine.com/t/does-an-owner-of-uproperty-member-need-to-be-also-declared-with-uproperty-for-garbage-collector-to-work-properly/1468196 "2023-12-04T11:09:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hzn84](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hzn84](https://forums.unrealengine.com/u/hzn84)\
**Post date:** [December 4, 2023, 11:09am UTC](https://forums.unrealengine.com/t/does-an-owner-of-uproperty-member-need-to-be-also-declared-with-uproperty-for-garbage-collector-to-work-properly/1468196/1 "2023-12-04T11:09:21Z")

</div>

What would happen if I would have situation like below:

```auto
USTRUCT()
struct FChild {
   GENERATED_BODY()

   UPROPERTY()
   UObject* MyObject;
}

UCLASS()
class UParentClass: public UObject {
    GENERATED_BODY()

   FChild Child;
}

```

Would GC work correctly if my Child member in UParentClass wouldn’t have UPROPERTY set? Would UPROPERTY macro declared inside FChild struct be enough? Or does it need continouos UPROPERTY chain from root to leaf?

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [December 5, 2023, 9:21am UTC](https://forums.unrealengine.com/t/does-an-owner-of-uproperty-member-need-to-be-also-declared-with-uproperty-for-garbage-collector-to-work-properly/1468196/2 "2023-12-05T09:21:44Z")

</div>

It does need a continuous chain from root to leaf, however UPROPERTY is not the only way to chain. You can also use `AddReferencedObjects` to manually chain objects.
