views:

250

answers:

1
+1  A: 

It won't help, possibly with your leak, but you are reloading an array every 40ms with data that hasn't changed.

You may want to use a closure around the initialization.

Basically, just create a variable that has the function with the loop, with the pix info enclosed within it.

Then, you just continue to recursively call where you don't reinitialize, but just use the variable with the loop.

This way you reuse the same pix info, it maintains it's state, which should be fine, unless you edit the canvas elsewhere.

James Black
That did the trick, thanks!
Jonas Elfström