# GC when setting styleSheet

**URL:** <https://forum.kirupa.com/t/gc-when-setting-stylesheet/312999>\
**Category:** flash\
**Created:** [August 17, 2010, 9:59pm UTC](https://forum.kirupa.com/t/gc-when-setting-stylesheet/312999 "2010-08-17T21:59:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [August 17, 2010, 9:59pm UTC](https://forum.kirupa.com/t/gc-when-setting-stylesheet/312999/1 "2010-08-17T21:59:01Z")

</div>

I don’t know how to test this and I think I’m over thinking it, but here is the situation:

Let’s say I have a styleSheet that is assigned as a public static var of a Class. Then, in various other Classes, I’m dynamically creating TextFields and assigning their styleSheet property to the static styleSheet var.

I eventually remove those said TextFields from the DisplayObject they’re on and delete all references. Even though they’ve been removed/cleared, are they retained in memory because they still contain reference to the static var styleSheet? i.e. should I be setting textField.styleSheet=null; before removing?

I don’t have a case where I suspect this, but I just started thinking about this… again, maybe over thinking this.
