提交 bce22389 编写于 作者: D Don McCurdy

Clean up Blob resources.

上级 d0b32bfe
......@@ -1074,11 +1074,13 @@ THREE.GLTF2Loader = ( function () {
var source = json.images[ texture.source ];
var sourceUri = source.uri;
var urlCreator;
if ( source.bufferView !== undefined ) {
var bufferView = dependencies.bufferViews[ source.bufferView ];
var blob = new Blob( [ bufferView ], { type: source.mimeType } );
var urlCreator = window.URL || window.webkitURL;
urlCreator = window.URL || window.webkitURL;
sourceUri = urlCreator.createObjectURL( blob );
}
......@@ -1095,6 +1097,12 @@ THREE.GLTF2Loader = ( function () {
textureLoader.load( resolveURL( sourceUri, options.path ), function ( _texture ) {
if ( urlCreator !== undefined ) {
urlCreator.revokeObjectURL( sourceUri );
}
_texture.flipY = false;
if ( texture.name !== undefined ) _texture.name = texture.name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册