Ver código fonte

Remove onload callback after its fired (avoid leaks) (#9649)

Benjamin Dobell 9 anos atrás
pai
commit
1398a401dd
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      src/loaders/ImageLoader.js

+ 2 - 0
src/loaders/ImageLoader.js

@@ -20,6 +20,8 @@ Object.assign( ImageLoader.prototype, {
 		var image = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'img' );
 		image.onload = function () {
 
+			image.onload = null;
+
 			URL.revokeObjectURL( image.src );
 
 			if ( onLoad ) onLoad( image );