# Pointer to subobject gets invalid after creation

**URL:** <https://forums.unrealengine.com/t/pointer-to-subobject-gets-invalid-after-creation/430833>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 2, 2018, 8:09pm UTC](https://forums.unrealengine.com/t/pointer-to-subobject-gets-invalid-after-creation/430833 "2018-08-02T20:09:01Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![ekicam2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ekicam2](https://forums.unrealengine.com/u/ekicam2)\
**Post date:** [August 15, 2018, 5:27pm UTC](https://forums.unrealengine.com/t/pointer-to-subobject-gets-invalid-after-creation/430833/17 "2018-08-15T17:27:04Z")

</div>

As far as I can see you are missing a lot UPROPERTY() tags above pointers. That could mean that the CoverHelper instance is deleted by the GC as a result of the references. Rule of thumb always mark your pointers as UPROPERTY **always**.

You can read more about garbage collection here:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

_[View the full topic](https://forums.unrealengine.com/t/pointer-to-subobject-gets-invalid-after-creation/430833)._
