Dynamically allocate large WASM G-code sources
This commit is contained in:
@@ -271,5 +271,11 @@ export class WasmProgramRuntime {
|
||||
} finally { this.core._free(buffer); }
|
||||
}
|
||||
|
||||
destroy() { for (const pointer of [this.pointer, this.motionPointer, this.samplePointer, this.samplePosePointer]) if (pointer && typeof this.core?._free === "function") this.core._free(pointer); this.pointer = this.motionPointer = this.samplePointer = this.samplePosePointer = 0; this.executionSource = ""; this.executionLines = []; }
|
||||
destroy() {
|
||||
if (this.pointer && (typeof this.core?._sim_program_destroy === "function" || typeof this.core?.sim_program_destroy === "function")) call(this.core, "sim_program_destroy", "number", ["number"], [this.pointer]);
|
||||
for (const pointer of [this.pointer, this.motionPointer, this.samplePointer, this.samplePosePointer]) if (pointer && typeof this.core?._free === "function") this.core._free(pointer);
|
||||
this.pointer = this.motionPointer = this.samplePointer = this.samplePosePointer = 0;
|
||||
this.executionSource = "";
|
||||
this.executionLines = [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user