So, I’m using OpenGl and OpenAl in my game. The problem I have is when the application crashes and these two “things” aren’t closed down properly. I have a feeling this isn’t too good.
My question is how I can I efficiently close these two “things” when the game crashes. Do I put the entire initiation and start of the game in a try/catch block
try{
start display.
init Gl
init Al
create instance of game
start game
}catch {
GL.destroy
Al.destroy
}
Maybe I should start the entire game as its own thread and then close the Al and Gl in the main thread?