Release Navara overlay targets and sprite images on repeated globe switches

This commit is contained in:
German Khokhlov committed 2026-11-03 05:04:38 +04:00
1 parent 160e445677
commit 14f7b32537
4 files changed
+118 -1

No files matched your search

+7
View File
@@ -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();