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

objmem: prevent calling audio_RemoveObj() from the destructors of in-game objects #4033

Merged

Commits on Aug 11, 2024

  1. objmem: remove audio_RemoveObj call from the dtors of the common in…

    …-game objects
    
    The call to `audio_RemoveObj` inside the destructors of
    `SIMPLE_OBJECT`, `DROID`, `STRUCTURE`, `FEATURE` and `PROJECTILE`
    classes can possibly invoke undefined behavior if the
    warzone process is being forcefully shut down.
    
    The reason for this is that by the time a given game object
    is being destroyed, chances are that the static objects
    from the audio code, which are being accessed by the
    `audio_RemoveObj()`, can already be destroyed (due to the inverse
    of the [Static initialization order fiasco](https://en.cppreference.com/w/cpp/language/siof)).
    
    Signed-off-by: Pavel Solodovnikov <[email protected]>
    ManManson committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    97fc9e5 View commit details
    Browse the repository at this point in the history