Skip to content

Remove receivers from Router IpcReceiverSet on channel close.#400

Merged
jdm merged 1 commit intomainfrom
router-leak
Jul 22, 2025
Merged

Remove receivers from Router IpcReceiverSet on channel close.#400
jdm merged 1 commit intomainfrom
router-leak

Conversation

@jdm
Copy link
Copy Markdown
Member

@jdm jdm commented Jul 21, 2025

Fixes #399.

@jdm

This comment was marked as resolved.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
@jdm jdm marked this pull request as ready for review July 22, 2025 19:42
Comment thread src/platform/macos/mod.rs
impl Drop for OsIpcReceiverSet {
fn drop(&mut self) {
for port in &self.ports {
mach_port_mod_release(*port, MACH_PORT_RIGHT_RECEIVE).unwrap();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess now OsIpcReceiver owns cleanup?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

@jdm jdm added this pull request to the merge queue Jul 22, 2025
Merged via the queue into main with commit 4c2cbf8 Jul 22, 2025
16 checks passed
@jdm jdm mentioned this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unbounded leak of mach ports when using Router on macOS

2 participants