# Timers and garbage collection

**URL:** <https://forum.kirupa.com/t/timers-and-garbage-collection/296525>\
**Category:** flash\
**Created:** [September 16, 2009, 2:55am UTC](https://forum.kirupa.com/t/timers-and-garbage-collection/296525 "2009-09-16T02:55:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![finky45](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@finky45](https://forum.kirupa.com/u/finky45)\
**Post date:** [September 16, 2009, 2:55am UTC](https://forum.kirupa.com/t/timers-and-garbage-collection/296525/1 "2009-09-16T02:55:24Z")

</div>

I’m a novice so I need a little help with a game I am working on.

I have an object that contains a timer. I do addEventListener on the timer and start the timer.  
At some point the object is deleted but I find that the timer keeps firing (using trace statements).

What gives?

What I don’t get is, how come when I delete the only object that has a reference to that timer, the timer doesn’t go away along with the event? Or do I have to do a removeEventListener() on the timer before removing the object for it to go away?
