@tscircuit/3d-viewer 0.0.425 → 0.0.426

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +13 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -26789,7 +26789,7 @@ import * as THREE14 from "three";
26789
26789
  // package.json
26790
26790
  var package_default = {
26791
26791
  name: "@tscircuit/3d-viewer",
26792
- version: "0.0.424",
26792
+ version: "0.0.425",
26793
26793
  main: "./dist/index.js",
26794
26794
  module: "./dist/index.js",
26795
26795
  type: "module",
@@ -31355,7 +31355,17 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
31355
31355
  setError(null);
31356
31356
  const Manifold = manifoldJSModule.Manifold;
31357
31357
  const CrossSection = manifoldJSModule.CrossSection;
31358
- manifoldInstancesForCleanup.current.forEach((inst) => inst.delete());
31358
+ const safeDelete = (inst) => {
31359
+ if (!inst || typeof inst.delete !== "function") return;
31360
+ try {
31361
+ inst.delete();
31362
+ } catch (error2) {
31363
+ if (!(error2 instanceof Error) || !error2.message?.includes("Manifold instance already deleted")) {
31364
+ console.warn("Failed to delete Manifold instance", error2);
31365
+ }
31366
+ }
31367
+ };
31368
+ manifoldInstancesForCleanup.current.forEach(safeDelete);
31359
31369
  manifoldInstancesForCleanup.current = [];
31360
31370
  let boardManifold = null;
31361
31371
  const currentGeoms = {};
@@ -31559,7 +31569,7 @@ var useManifoldBoardBuilder = (manifoldJSModule, circuitJson) => {
31559
31569
  setIsLoading(false);
31560
31570
  }
31561
31571
  return () => {
31562
- manifoldInstancesForCleanup.current.forEach((inst) => inst.delete());
31572
+ manifoldInstancesForCleanup.current.forEach(safeDelete);
31563
31573
  manifoldInstancesForCleanup.current = [];
31564
31574
  };
31565
31575
  }, [manifoldJSModule, circuitJson, boardData]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/3d-viewer",
3
- "version": "0.0.425",
3
+ "version": "0.0.426",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "type": "module",