Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

perf(formula): memory leak (#6133)

Univer1a44a5634b39
diff --git a/packages/engine-formula/src/engine/ast-node/base-ast-node.ts b/packages/engine-formula/src/engine/ast-node/base-ast-node.ts
index 1a46291afc..69719ab3ef 100644
--- a/packages/engine-formula/src/engine/ast-node/base-ast-node.ts
+++ b/packages/engine-formula/src/engine/ast-node/base-ast-node.ts
@@ -71,6 +71,14 @@ export class BaseAstNode {
return NodeType.BASE;
}
+ resetCalculationState() {
+ this._children.forEach((node) => {
+ node.resetCalculationState();
+ });
+ this._valueObject = null;
+ this._calculateState = false;
+ }
+
isAsync() {
return this._async;
}