Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IntoRawHandle impl for FFI ownership transfer #199

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

RossSmyth
Copy link
Contributor

Basically the inverse of FromRawHandle. Allows an FFI application to take ownership of the handle without leaking a String if constructed on the Rust side.

@sirhcel
Copy link
Contributor

sirhcel commented Jul 10, 2024

Thank you for this PR! Also providing IntoRawHandle looks like the right companion for AsRawHandle.

Allows an FFI application to take ownership of the handle without leaking a String if constructed on the Rust side.

Do you mean leaking COMPort::port_name (if present) when mem::forget-ting a COMPort for not closing it on drop?

@RossSmyth
Copy link
Contributor Author

Yeah

@sirhcel
Copy link
Contributor

sirhcel commented Jul 11, 2024

Alright. Thank you! Could you please add a changelog entry for integrating?

@RossSmyth
Copy link
Contributor Author

Done

@sirhcel
Copy link
Contributor

sirhcel commented Jul 12, 2024

Awesome! Thank you very much!

@sirhcel sirhcel merged commit f62f3b7 into serialport:main Jul 12, 2024
30 checks passed
@RossSmyth RossSmyth deleted the IntoHandle branch July 12, 2024 17:45
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.

2 participants