# Duplicate event listeners

**URL:** <https://forum.kirupa.com/t/duplicate-event-listeners/318680>\
**Category:** Uncategorized\
**Created:** [January 27, 2011, 3:14am UTC](https://forum.kirupa.com/t/duplicate-event-listeners/318680 "2011-01-27T03:14:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbo](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tbo](https://forum.kirupa.com/u/tbo)\
**Post date:** [January 27, 2011, 3:14am UTC](https://forum.kirupa.com/t/duplicate-event-listeners/318680/1 "2011-01-27T03:14:58Z")

</div>

some time ago i asked about this, and i believe it was senocular who advised me nothing happens if you attempt to add an already existent event listener.

example: this only fires once per frame

```auto

addEventListener(Event.ENTER_FRAME, myFunc);
addEventListener(Event.ENTER_FRAME, myFunc);

```

So im wondering now, as coding practice does anyone ever run a function, or a class, to like clean all possible event listeners in the class upon destruction? Whether they exist or not.

```auto
function cleanListeners(){
  // remove mouse listeners
  // remove enter frame listener 
  // remove ...well i suppose i don't really have that many listeners
}

```

So even if the listener is not there, the only down side i see is possibly running a few extra lines of code and the speed associated with that.
