Skip to content

Commit

Permalink
hack avoid publicodes memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
mquandalle committed Jan 7, 2024
1 parent e6418a1 commit 0e909bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export const engine = new Publicodes(
export function getEngine(situation) {
const engineBis = engine.shallowCopy();
engineBis.setSituation(situation ?? {});

// HACK: avoid publicodes memory leak
// cf. https://github.com/publicodes/publicodes/issues/239
engine.subEngines = [];

// HACK: traversedVariablesStack are removed from the public API, but still calculated if requested.
// The way to ask the engine to compute traversedVariables is to initialize the stack with an empty array.
// cf. https://github.com/publicodes/publicodes/issues/422 https://github.com/publicodes/publicodes/pull/432
Expand Down

0 comments on commit 0e909bc

Please sign in to comment.