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

Use SDL_GetError for sdl2::ttf::init instead of the last OS error #1348

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 4, 2023

  1. Use SDL_GetError for sdl2::ttf::init instead of the last OS error

    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 Rust-SDL2#1347.
    Maeve Sproule committed Nov 4, 2023
    Configuration menu
    Copy the full SHA
    dd3721b View commit details
    Browse the repository at this point in the history