Skip to content

Commit 058e822

Browse files
committed
Fix process shutdown bugs: remove incorrect killed flag check and snapshot map keys during iteration
1 parent 3bfa481 commit 058e822

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/mcp/tools/swift-package/active-processes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async function terminateProcess(
6464
return { error: error instanceof Error ? error.message : String(error) };
6565
}
6666

67-
const alreadyExited = info.process.exitCode != null || info.process.killed === true;
67+
const alreadyExited = info.process.exitCode != null;
6868
if (alreadyExited) {
6969
return {};
7070
}

src/utils/video_capture.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ function ensureSignalHandlersAttached(): void {
113113
signalHandlersAttached = true;
114114

115115
const stopAll = (): void => {
116-
for (const simulatorUuid of sessions.keys()) {
116+
const simulatorIds = Array.from(sessions.keys());
117+
for (const simulatorUuid of simulatorIds) {
117118
void stopSession(simulatorUuid, { timeoutMs: 250 });
118119
}
119120
};

0 commit comments

Comments
 (0)