# Garbage Collection Details?

**URL:** <https://forum.kirupa.com/t/garbage-collection-details/276724>\
**Category:** flash\
**Created:** [December 3, 2008, 12:38am UTC](https://forum.kirupa.com/t/garbage-collection-details/276724 "2008-12-03T00:38:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![El\_Phantom](https://avatars.discourse-cdn.com/v4/letter/e/d6d6ee/32.png) [@El\_Phantom](https://forum.kirupa.com/u/El_Phantom)\
**Post date:** [December 3, 2008, 12:38am UTC](https://forum.kirupa.com/t/garbage-collection-details/276724/1 "2008-12-03T00:38:33Z")

</div>

Hey everybody, I have searched the forums and google and so far have not found any definitive answers for the details of AS3 garbage collection, I was hoping somebody might be able to answer a couple questions?

1. Let’s say I have an instance of a class that contains an Object. In the past I have written a dispose() or similar method for that class that nulls that object, and then I null the class instance itself. Am I wasting my time with a dispose method? If the only reference to the object is in the class instance, does nullifying the class instance remove the need for a dispose() method, or does the reference persist because I didn’t null it explicitly?

2. Do function vars that are objects need to be nulled, or do they go out of scope at the end of the function. i.e var myObject:Object = new Object(); ?

thanks everyone!

–EP
