mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 18:52:18 +00:00
Release Navara overlay targets and sprite images on repeated globe switches
This commit is contained in:
1 parent
160e445677
commit
14f7b32537
4 files changed
+118
-1
No files matched your search
@@ -217,7 +217,14 @@ function atlasTexture(atlas, encoded, onLoad) {
|
||||
const texture = cesiumSampling(new Texture(), encoded);
|
||||
const image = new Image();
|
||||
image.crossOrigin = 'anonymous';
|
||||
const release = () => {
|
||||
image.onload = null;
|
||||
texture.image = null;
|
||||
texture.removeEventListener('dispose', release);
|
||||
};
|
||||
texture.addEventListener('dispose', release);
|
||||
image.onload = () => {
|
||||
image.onload = null;
|
||||
texture.image = image;
|
||||
texture.needsUpdate = true;
|
||||
onLoad();
|
||||
|
||||
Reference in new issue
Block a user