开发者

Disposable, one-time IMGs for drawImage

When I createElement("IMG") solely for the purpose of using it in a 2d canvas using "drawImage", will the temporary IMG be eligible for a garbage collection? or will the canvas hold a reference to it (if so, how can I clear this reference)?开发者_如何转开发


It ought to be eligible for garbage collection, but of course each browser could (in theory) implement it differently.

If it is not eligible for garbage collection once you have cleared all references to it then that is a bug.

That being said, I imagine a lot of browsers hold on to the image in cache anyway so even if the Image object is garbage collected, making a new Image object with the same src may load instantly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜