Remove the src attribute from Image objects used with natively supported JPEG images, when pages are cleaned-up/destroyed

This will further help reduce the amount of image data that's currently being held alive, by explicitly removing the `src` attribute.

Please note that this is mostly relevant for browsers which do not support `URL.createObjectURL`, or where `disableCreateObjectURL` was manually set by the user, since `blob:` URLs will be revoked (see the previous patch).
However, using `about:memory` (in Firefox) it does seem that this may also be generally helpful, given that calling `URL.revokeObjectURL` won't invalidate the image data itself (as far as I can tell).
This commit is contained in:
Jonas Jenwald 2019-03-14 14:35:09 +01:00
parent 983b25f863
commit 88d5750030

View File

@ -488,6 +488,7 @@ function releaseImageResources(img) {
URL.revokeObjectURL) { URL.revokeObjectURL) {
URL.revokeObjectURL(url); URL.revokeObjectURL(url);
} }
img.removeAttribute('src');
} }
export { export {