Skip to content

Commit

Permalink
fix: image reference (galacean#432)
Browse files Browse the repository at this point in the history
* fix: image reference
  • Loading branch information
PlateArmourProgrammer authored Aug 16, 2021
1 parent db6d221 commit 6fa5367
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/asset/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ function requestImage<T>(url: string, config: RequestConfig): AssetPromise<T> {
requestAnimationFrame(() => {
//@ts-ignore
resolve(img);
img.onload = null;
img.onerror = null;
img.onabort = null;
});
clearTimeout(timeoutId);
};
Expand Down
3 changes: 3 additions & 0 deletions packages/loader/src/gltf/GLTFUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ export class GLTFUtil {
// Call requestAnimationFrame to avoid iOS's bug.
requestAnimationFrame(() => {
resolve(img);
img.onload = null;
img.onerror = null;
img.onabort = null;
});
};
});
Expand Down

0 comments on commit 6fa5367

Please sign in to comment.