MCPcopy
hub / github.com/sparkjsdev/spark / dispose

Method dispose

src/OldSparkViewpoint.ts:241–260  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

239 // Call this when you are done with the SparkViewpoint and want to
240 // free up its resources (GPU targets, pixel buffers, etc.)
241 dispose() {
242 this.setAutoUpdate(false);
243 if (this.target) {
244 this.target.dispose();
245 this.target = undefined;
246 }
247 if (this.back) {
248 this.back.dispose();
249 this.back = undefined;
250 }
251 if (this.display) {
252 this.spark.releaseAccumulator(this.display.accumulator);
253 this.display.geometry.dispose();
254 this.display = null;
255 }
256 if (this.pending?.accumulator) {
257 this.spark.releaseAccumulator(this.pending.accumulator);
258 this.pending = null;
259 }
260 }
261
262 // Use this function to change whether this viewpoint will auto-update
263 // its sort order whenever the attached SparkRenderer updates the Gsplats.

Callers

nothing calls this directly

Calls 3

setAutoUpdateMethod · 0.95
releaseAccumulatorMethod · 0.80
disposeMethod · 0.65

Tested by

no test coverage detected