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

String won't drop #97

Open
duckfromdiscord opened this issue Oct 26, 2024 · 2 comments
Open

String won't drop #97

duckfromdiscord opened this issue Oct 26, 2024 · 2 comments

Comments

@duckfromdiscord
Copy link

I am using your instructions to create a CString in Rust, then return its into_raw() to C# and pass that back to Rust to be dropped, but when I go to drop it crashes the entire program. If I print the string at that pointer, it's garbage data. What could be happening?

@neuecc
Copy link
Member

neuecc commented Oct 28, 2024

The CString section was written as an example of how the passing of CStrings would be done with this method signature.
It would be better to make it work properly...

@duckfromdiscord
Copy link
Author

I think maybe C# is dropping the string by itself before it comes back to Rust to do it

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

No branches or pull requests

2 participants