fix(sdk): capture loader ref in unpackGroup to prevent race condition on done() cleanup
This commit is contained in:
parent
e78afc73f3
commit
6720a3e730
@ -1337,6 +1337,9 @@ export class Package {
|
||||
//const db = window.VIEWPORT.modules["db"];
|
||||
//const dbTable = `${useProjectState.getState().sceneId}-${useProjectState.getState().info.id}`;
|
||||
|
||||
// 在调用时捕获 loader 引用,防止 done() 清除 this.loader 后重试路径报错
|
||||
const loader = this.loader;
|
||||
|
||||
// map 存储 json 解析完成后执行的 function; key 为 uuid
|
||||
const funcMap = new Map<string, Function>();
|
||||
|
||||
@ -1433,7 +1436,8 @@ export class Package {
|
||||
|
||||
const parse = (json) => {
|
||||
if (check(json.object, json)) {
|
||||
this.loader.parse(json, (group) => {
|
||||
if (!loader) return;
|
||||
loader.parse(json, (group) => {
|
||||
const bones: Bone[] = [];
|
||||
group.getObjectsByProperty("type", "Bone", bones);
|
||||
if (bones.length > 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user