Skip to content

Commit

Permalink
feat: when zcfSeats exit or fail, delete objects holding cycles (#8697)
Browse files Browse the repository at this point in the history
in zcfSeat.js: zcfSeatToSeatHandle.delete(self)
in exit.js:    state.zccfSeat = undefined
  • Loading branch information
Chris-Hibbert committed Mar 1, 2024
1 parent bdf582e commit 5d5722f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/zoe/src/contractFacet/exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const makeMakeExiter = baggage => {
exit() {
const { state } = this;
state.zcfSeat.exit();
state.zcfSeat = undefined;
},
},
{
Expand Down
2 changes: 2 additions & 0 deletions packages/zoe/src/contractFacet/zcfSeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const createSeatManager = (
assertNoStagedAllocation(self);
doExitSeat(self);
E(zoeInstanceAdmin).exitSeat(zcfSeatToSeatHandle.get(self), completion);

Check warning on line 161 in packages/zoe/src/contractFacet/zcfSeat.js

View workflow job for this annotation

GitHub Actions / lint-primary

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator
zcfSeatToSeatHandle.delete(self);
},
fail(
reason = Error(
Expand All @@ -179,6 +180,7 @@ export const createSeatManager = (
zcfSeatToSeatHandle.get(self),
harden(reason),
);
zcfSeatToSeatHandle.delete(self);
}
return reason;
},
Expand Down

0 comments on commit 5d5722f

Please sign in to comment.