소스 검색

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

Benjamin Dobell 9 년 전
부모
커밋
1398a401dd
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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 );