csbindgen icon indicating copy to clipboard operation
csbindgen copied to clipboard

String won't drop

Open duckfromdiscord opened this issue 1 year ago • 3 comments

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?

duckfromdiscord avatar Oct 26 '24 22:10 duckfromdiscord

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...

neuecc avatar Oct 28 '24 07:10 neuecc

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

duckfromdiscord avatar Oct 28 '24 15:10 duckfromdiscord

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Apr 27 '25 00:04 github-actions[bot]