# Garbage Collector Question

**URL:** <https://forum.kirupa.com/t/garbage-collector-question/240316>\
**Category:** flash\
**Created:** [October 2, 2007, 1:15am UTC](https://forum.kirupa.com/t/garbage-collector-question/240316 "2007-10-02T01:15:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![endemoniada](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@endemoniada](https://forum.kirupa.com/u/endemoniada)\
**Post date:** [October 2, 2007, 1:15am UTC](https://forum.kirupa.com/t/garbage-collector-question/240316/1 "2007-10-02T01:15:19Z")

</div>

Hi guys,

What if something like this occurs:

myObject=new MyObject();  
//do some stuff with it then free the memory  
delete(myObject);

// hopefully the Garbage Collector ran a sweep but what if it didn’t ?

// now I need it again  
myObject=new MyObject();

I run into that scenario a lot.

Thanks.
