Skip to content

Commit 455ed50

Browse files
committed
Clear activeMounts on container stop
Applies memory leak prevention from this PR to the activeMounts feature that was merged from main. When a container stops or restarts, mount points become invalid but the Map still held stale references. Clearing it maintains consistency with portTokens and defaultSession.
1 parent 1f0439a commit 455ed50

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/sandbox/src/sandbox.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ export class Sandbox<Env = unknown> extends Container<Env> implements ISandbox {
764764
// This prevents stale references after container restarts
765765
this.portTokens.clear();
766766
this.defaultSession = null;
767+
this.activeMounts.clear();
767768

768769
// Persist cleanup to storage so state is clean on next container start
769770
await Promise.all([

0 commit comments

Comments
 (0)