File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export default class TextureManager {
5353 for ( let i = 0 , n = this . _uploadedTextureSources . length ; i < n ; i ++ ) {
5454 this . _nativeFreeTextureSource ( this . _uploadedTextureSources [ i ] ) ;
5555 }
56-
56+
5757 this . textureSourceHashmap . clear ( ) ;
5858 this . _usedMemory = 0 ;
5959 }
@@ -95,7 +95,7 @@ export default class TextureManager {
9595 nativeTexture . update = this . stage . frameCounter ;
9696
9797 this . _uploadedTextureSources . push ( textureSource ) ;
98-
98+
9999 this . addToLookupMap ( textureSource ) ;
100100
101101 // add VRAM tracking if using the webgl renderer
@@ -140,7 +140,7 @@ export default class TextureManager {
140140 gc ( ) {
141141 this . freeUnusedTextureSources ( ) ;
142142 }
143-
143+
144144 freeUnusedTextureSources ( ) {
145145 let remainingTextureSources = [ ] ;
146146 for ( let i = 0 , n = this . _uploadedTextureSources . length ; i < n ; i ++ ) {
@@ -195,6 +195,10 @@ export default class TextureManager {
195195 this . _nativeFreeTextureSource ( textureSource ) ;
196196 }
197197
198+ if ( textureSource . lookupId ) {
199+ this . textureSourceHashmap . delete ( textureSource . lookupId ) ;
200+ }
201+
198202 // Should be reloaded.
199203 textureSource . loadingSince = null ;
200204 }
You can’t perform that action at this time.
0 commit comments