removing an event listener

If I have a number of objects in a table each with an event listener, if I nil one of those table entries do I also have to manually remove the event listener as well or is it done automagically?

Cheers
[import]uid: 7841 topic_id: 19929 reply_id: 319929[/import]

without testing it I’d say you have to remove the listeners manually.
but that’s just one line to add:

 for i,val in pairs(objTable) do  
  
 Runtime:removeEventListener( "enterFrame", val.theEnterFrameFunction );  
 val.object:removeSelf();  
 objTable[i] = nil;  
  
 end   

again, I didn’t test it. but it should work…

-finefin [import]uid: 70635 topic_id: 19929 reply_id: 77544[/import]

Cheers. Wasn’t sure if nilling the table entry removed the event listener as well.
One extra line of code doesn’t hurt :slight_smile:
[import]uid: 7841 topic_id: 19929 reply_id: 77580[/import]