Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ttf: Use SDL_GetError for initialization errors
Previously, the code use the last OS error. However, not all errors returned by `TTF_Init` are OS errors, and the expected behaviour is that the caller instead use `SDL_GetError` when an error is encountered. To limit breakage for existing application the error is still returned as an `io::Error`, albeit one with `io::ErrorKind::Other`. It is worth noting that this does lead to an observable difference in behaviour for callers – the error has a different kind – although any code that is inspecting this was already relying on an unreliable source of data. This fixes issue #1347.
- Loading branch information