From a2a9c2a36d7dab9d3c143b66156a27ac48c58672 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Tue, 2 Jan 2024 09:30:12 -0800 Subject: [PATCH] feat: when zcfSeats exit or fail, delete objects holding cycles (#8697) in zcfSeat.js: zcfSeatToSeatHandle.delete(self) in exit.js: state.zccfSeat = undefined --- packages/zoe/src/contractFacet/exit.js | 1 + packages/zoe/src/contractFacet/zcfSeat.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/zoe/src/contractFacet/exit.js b/packages/zoe/src/contractFacet/exit.js index 2d541ba2806..ac1cd92791e 100644 --- a/packages/zoe/src/contractFacet/exit.js +++ b/packages/zoe/src/contractFacet/exit.js @@ -35,6 +35,7 @@ export const makeMakeExiter = baggage => { exit() { const { state } = this; state.zcfSeat.exit(); + state.zcfSeat = undefined; }, }, { diff --git a/packages/zoe/src/contractFacet/zcfSeat.js b/packages/zoe/src/contractFacet/zcfSeat.js index 2ba5f7e4796..15cc5403d12 100644 --- a/packages/zoe/src/contractFacet/zcfSeat.js +++ b/packages/zoe/src/contractFacet/zcfSeat.js @@ -159,6 +159,7 @@ export const createSeatManager = ( assertNoStagedAllocation(self); doExitSeat(self); E(zoeInstanceAdmin).exitSeat(zcfSeatToSeatHandle.get(self), completion); + zcfSeatToSeatHandle.delete(self); }, fail( reason = Error( @@ -179,6 +180,7 @@ export const createSeatManager = ( zcfSeatToSeatHandle.get(self), harden(reason), ); + zcfSeatToSeatHandle.delete(self); } return reason; },