As @Robin says, it's worth checking for timers (and also watches - with console.log(global["\xFF"].watches);).
Ideally dump them with no watch face loaded, then load the watch face, unload it, and see if anything else is there.
One option is to use dump() - you'll have to ignore the second half of the code (which is just the bootloader) but the first half is a reconstruction of what is in RAM. Run it as suggested above, then 'diff' the two results and see what is different.
Just a note on freeResources - you don't have to set any of the variables you defined inside your function to undefined. As long as you don't reference the function from anywhere else, everything inside it will be freed automatically.
However the trick is ensuring that you're really not referencing that function from anywhere!
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
As @Robin says, it's worth checking for timers (and also watches - with
console.log(global["\xFF"].watches);
).Ideally dump them with no watch face loaded, then load the watch face, unload it, and see if anything else is there.
One option is to use
dump()
- you'll have to ignore the second half of the code (which is just the bootloader) but the first half is a reconstruction of what is in RAM. Run it as suggested above, then 'diff' the two results and see what is different.Just a note on
freeResources
- you don't have to set any of the variables you defined inside your function toundefined
. As long as you don't reference the function from anywhere else, everything inside it will be freed automatically.However the trick is ensuring that you're really not referencing that function from anywhere!