Kaynağa Gözat

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

Benjamin Dobell 9 yıl önce
ebeveyn
işleme
1398a401dd
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  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 );