Jon Beebe - Managing your runtime listeners

There once was an interesting blog post written by Jon Beebe on managing and wholesale removal of your listeners.

There was a code example to accomplish the aforementioned task.

It used to be located below:

http://jonbeebe.net/managing-your-runtime-listeners

That page no longer exists, and the Internet Wayback Machine does not have an archive of that page.

Does anyone know where this page now lives? Is there anyone who has an archive of it?

I really need this too!

Come on John, put us out of our misery.

Lol, I almost missed this thread, good thing I didn't :-)

Anyway, I don't have that post specifically, but I did repost one article that was a follow-up to that article, which I believe has all the same info here:

http://blog.anscamobile.com/2011/08/corona-sdk-memory-leak-prevention-101/

I was about to repost the entire original article (I have it here), but then I remembered that the entire post was pretty much theory. When I got down to actually testing it, it ended up producing some leaks that I haven't got around to fixing yet, so I don't recommend using the code from that article.

Really all it takes is just to be mindful whenever you add the line: Runtime:addEventListener...

Keep a tally if you have to, and just make sure you're removing the listener at some point and you shouldn't run into problems with that.

Yeah, I know how to keep things clean, but in my hast of coding, I can occasionally forget something and get a leak...

I am working on a "module" that will handle everything for me by adding the important things to tables to clean automagically...I just wanted to have someplace to start, since the call to Runtime:addEventListener doesn't return anything, I was left scratching my head for a minute, before I put it on the back burner for later.

views:1735 update:2011/10/19 14:58:09
corona forums © 2003-2011