Skip to content

Commit 281cd7c

Browse files
mrxzlekzd
andauthored
SplatPager: null texture source to ensure underlying arrays can be GC'ed (#326)
Co-authored-by: Aleksandr Korotaev <lekzd@mail.ru>
1 parent f2cdf15 commit 281cd7c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/SplatPager.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,32 +827,41 @@ export class SplatPager {
827827
this.numFetchers = 0;
828828

829829
this.packedTexture.value.dispose();
830+
this.packedTexture.value.source.data = null;
830831
if (this.extTexture.value !== SplatPager.emptyExtTexture) {
831832
this.extTexture.value.dispose();
833+
this.extTexture.value.source.data = null;
832834
}
833835

834836
if (!this.extSplats) {
835837
if (this.sh1Texture.value !== SplatPager.emptySh1Texture) {
836838
this.sh1Texture.value.dispose();
839+
this.sh1Texture.value.source.data = null;
837840
}
838841
if (this.sh2Texture.value !== SplatPager.emptySh2Texture) {
839842
this.sh2Texture.value.dispose();
843+
this.sh2Texture.value.source.data = null;
840844
}
841845
if (this.sh3Texture.value !== SplatPager.emptySh3Texture) {
842846
this.sh3Texture.value.dispose();
847+
this.sh3Texture.value.source.data = null;
843848
}
844849
} else {
845850
if (this.sh1Texture.value !== SplatPager.emptyExtSh1Texture) {
846851
this.sh1Texture.value.dispose();
852+
this.sh1Texture.value.source.data = null;
847853
}
848854
if (this.sh2Texture.value !== SplatPager.emptyExtSh2Texture) {
849855
this.sh2Texture.value.dispose();
856+
this.sh2Texture.value.source.data = null;
850857
}
851858
if (this.sh3Texture.value !== SplatPager.emptyExtSh3Texture) {
852859
this.sh3Texture.value.dispose();
860+
this.sh3Texture.value.source.data = null;
853861
}
854862
if (this.sh3TextureB.value !== SplatPager.emptyExtSh3BTexture) {
855863
this.sh3TextureB.value.dispose();
864+
this.sh3TextureB.value.source.data = null;
856865
}
857866
}
858867
}

0 commit comments

Comments
 (0)