Shutting down (or restarting) the Steam launcher while the game is running causes SteamAPI.RunCallbacks() to permanently freeze the game/program.
I give an example:
1) Launch Steam.
2) Run the game, where SteamAPI.RunCallbacks() is and is called (I have this function called every frame).
3) Force close Steam (for example, through the Task Manager).
4) The game will freeze on the SteamAPI.RunCallbacks() function and never return (unless you have a "SteamAPI.IsSteamRunning()" check before calling "SteamAPI.RunCallbacks()").
If you add a "SteamAPI.IsSteamRunning()" check, then "SteamAPI.RunCallbacks()" will not be called until after the Steam Launcher is launched. However, when "SteamAPI.RunCallbacks()" is called while Steam is already running, RunCallbacks will never return and freeze the game.
Of course, under normal conditions, if Steam is working properly, users will not receive such an error, since when Steam is closed, the game itself is also closed. But, if it happens that Steam crashes (and reboots itself, if you use for check IsSteamRunning()), there is a chance that the game will freeze on the next call to SteamAPI.RunCallbacks().
P.s. At the same time, if you first start the game, and then the Steam Launcher, then RunCallbacks work out normally and do not freeze the game.
Shutting down (or restarting) the Steam launcher while the game is running causes SteamAPI.RunCallbacks() to permanently freeze the game/program.
I give an example: 1) Launch Steam. 2) Run the game, where SteamAPI.RunCallbacks() is and is called (I have this function called every frame). 3) Force close Steam (for example, through the Task Manager). 4) The game will freeze on the SteamAPI.RunCallbacks() function and never return (unless you have a "SteamAPI.IsSteamRunning()" check before calling "SteamAPI.RunCallbacks()").
If you add a "SteamAPI.IsSteamRunning()" check, then "SteamAPI.RunCallbacks()" will not be called until after the Steam Launcher is launched. However, when "SteamAPI.RunCallbacks()" is called while Steam is already running, RunCallbacks will never return and freeze the game.
Example of my code:
Of course, under normal conditions, if Steam is working properly, users will not receive such an error, since when Steam is closed, the game itself is also closed. But, if it happens that Steam crashes (and reboots itself, if you use for check IsSteamRunning()), there is a chance that the game will freeze on the next call to SteamAPI.RunCallbacks().
P.s. At the same time, if you first start the game, and then the Steam Launcher, then RunCallbacks work out normally and do not freeze the game.