How can I really delete a preloaded image from memory/disk cache? Let's
say I preload an image by creating an Image object and setting its src
attribute to desired URL:
var img = new Image();
img.src = [someurl];
Then I use the image a few more times by adding it into an Array
object:
var images = new Array();
images.push(img );
I found out that just calling 'delete' on a pointer to that Image
object, doesn't free up the RAM.
delete images[0]; //RAM is not freed here!
Should I call delete on all the references to the image object? This
would be a real pain, since I have to check about 3000 lines of code
for possible references to it and make sure I 'delete' all of them...
What about the other new Image objects, that get their src attribute
set to the same url?