gchp / rustbox

Rust implementation of the termbox library
MIT License
466 stars 48 forks source link

RAII guard should be unreverted for memory safety. #33

Closed pythonesque closed 9 years ago

pythonesque commented 9 years ago

https://github.com/gchp/rustbox/commit/23b75fb5a08279c25654bb27d9d954676fd90292 says it removes the RAII guard because it believes it is no longer needed. This is incorrect; the RAII guard is required for memory safety, because otherwise there is nothing preventing two instances of rustbox from existing at the same time (and the comments in the file explain why this is the case). The current implementation is not memory safe, so the guard should be added back.

gchp commented 9 years ago

@pythonesque let me know if I've missed anything here!

pythonesque commented 9 years ago

Looks good, thank you!