* @ignore
(image)
| 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 |