Explorar el Código

Editor: Revoke old ObjectURLs

Mr.doob hace 4 años
padre
commit
03397a7316
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      editor/js/Menubar.File.js

+ 6 - 2
editor/js/Menubar.File.js

@@ -488,12 +488,16 @@ function MenubarFile( editor ) {
 	var link = document.createElement( 'a' );
 	var link = document.createElement( 'a' );
 	function save( blob, filename ) {
 	function save( blob, filename ) {
 
 
+		if ( link.href ) {
+
+			URL.revokeObjectURL( link.href );
+
+		}
+
 		link.href = URL.createObjectURL( blob );
 		link.href = URL.createObjectURL( blob );
 		link.download = filename || 'data.json';
 		link.download = filename || 'data.json';
 		link.dispatchEvent( new MouseEvent( 'click' ) );
 		link.dispatchEvent( new MouseEvent( 'click' ) );
 
 
-		// URL.revokeObjectURL( url ); breaks Firefox...
-
 	}
 	}
 
 
 	function saveArrayBuffer( buffer, filename ) {
 	function saveArrayBuffer( buffer, filename ) {

粤ICP备19079148号