MCPcopy Create free account
hub / github.com/melonjs/melonJS / delete

Method delete

packages/melonjs/src/video/texture/cache.js:211–224  ·  view source on GitHub ↗

* @ignore

(image)

Source from the content-addressed store, hash-verified

209 * @ignore
210 */
211 delete(image) {
212 if (this.cache.has(image)) {
213 // Free every atlas registered under this image, not just the
214 // first one. Post-#1448 (units keyed by (source, repeat))
215 // multiple atlases can coexist for one image — freeing only
216 // `cache.get(image)[0]` would leak the remaining repeats'
217 // texture units after `this.cache.delete(image)` wipes the
218 // entire multimap bucket.
219 for (const texture of this.cache.get(image)) {
220 this.freeTextureUnit(texture);
221 }
222 this.cache.delete(image);
223 }
224 }
225
226 /**
227 * @ignore

Callers 15

addBodyMethod · 0.45
removeBodyMethod · 0.45
setGravityScaleMethod · 0.45
_unregisterLightMethod · 0.45
_unregisterLight3dMethod · 0.45
removeBodyMethod · 0.45
removeBodyMethod · 0.45
takeFromSetFunction · 0.45
unloadFunction · 0.45
destroyMethod · 0.45
freeTextureUnitMethod · 0.45
resetMethod · 0.45

Calls 3

freeTextureUnitMethod · 0.95
getMethod · 0.65
hasMethod · 0.45

Tested by 2

freshAlignmentStateFunction · 0.36
freshLitStateFunction · 0.36