MCPcopy
hub / github.com/simstudioai/sim / dispose

Function dispose

apps/sim/lib/pptx-renderer/renderer/slide-renderer.ts:285–306  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

283 const mediaUrlCache = ctx.mediaUrlCache
284
285 const dispose = (): void => {
286 if (disposed) return
287 disposed = true
288
289 // Dispose chart instances whose DOM is inside this slide container
290 if (chartInstances) {
291 for (const chart of chartInstances) {
292 if (!chart.isDisposed() && container.contains(chart.getDom())) {
293 chart.dispose()
294 chartInstances.delete(chart)
295 }
296 }
297 }
298
299 // Revoke blob URLs only in standalone mode (caller doesn't own a shared cache)
300 if (!isSharedCache) {
301 for (const url of mediaUrlCache.values()) {
302 URL.revokeObjectURL(url)
303 }
304 mediaUrlCache.clear()
305 }
306 }
307
308 return {
309 element: container,

Callers 1

[Symbol.dispose]Function · 0.70

Calls 4

containsMethod · 0.80
disposeMethod · 0.65
deleteMethod · 0.65
clearMethod · 0.65

Tested by

no test coverage detected