rust-sfml
rust-sfml copied to clipboard
Fonts loaded from memory require the source data buffer to be kept available
There is a warning about this on sfml documentation
When using this with rust, the font does not work if the buffer is dropped. This should be in the documentation.
I think for the time being I'll make from_memory unsafe and document the behavior. It would pollute the Font/Text APIs with lifetimes to fix this more thoroughly, which I don't have motivation for right now.
I created https://github.com/jeremyletang/rust-sfml/commit/7cc48d5781cacf85f31aa65a0b79eced5da3941f to address this.