Skip to content

Commit

Permalink
fix(swingset): comms: deleteRemoteMapping might free the object
Browse files Browse the repository at this point in the history
A "downstream retire" happens when the upstream/exported Remotable is
deleted (after all importers have dropped it). This triggers retirement from
the exporting side, rather than the importing side. The inbound
`dispatch.retireImport` or remote `retireImport` message causes the exporting
c-list entry to be removed. This doesn't change any refcounts (only importing
c-list entries influence the refcount), but it should still trigger a
`maybeFree` check. `processMaybeFree()` will notice the missing exporting
c-list entry, and will schedule notifications to all remaining importers.
  • Loading branch information
warner committed Jun 20, 2021
1 parent 03cdce8 commit e97a21d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/SwingSet/src/vats/comms/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ export function makeRemote(state, store, remoteID) {
if (isImport) {
state.removeImporter(lref, remoteID);
deleteLastSent(lref);
} else {
// deleting the upstream/export-side mapping should trigger
// processMaybeFree
state.lrefMightBeFree(lref);
}
}
}
Expand Down

0 comments on commit e97a21d

Please sign in to comment.