void quit () { if (isInit) { quitVideo (); quitAudio (); SDL_Quit (); isInit = false; } }
void Game::Finish() { if (pInstance == NULL) { return; } #ifdef GAME_EXECUTABLE // The game's done, so now we should free resources and shut down. #ifdef MLI_DEBUG cout << "Exiting game..." << endl; #endif // If we have a case open, we want to free all its resources. Case::DestroyInstance(); // Stop playing music/SFX/dialog and shut down the audio thread. quitAudio(); // Unload preloaded music and free memory for (unsigned int i = 0; i < builtInBgmCount; i++) { ResourceLoader::GetInstance()->UnloadMusic(bgmIdList[i]); } #else // Cleanup network connectivity functionality. curl_easy_cleanup(gpCurlHandle); gpCurlHandle = NULL; curl_global_cleanup(); #endif // This game object is now defunct, so delete it. delete pInstance; pInstance = NULL; #ifdef GAME_EXECUTABLE // Close all open fonts and shut down the font thread. TTF_Quit(); EventProviders::Close(); #endif // Free the renderer and window. if (gpRenderer != NULL) { SDL_DestroyRenderer(gpRenderer); gpRenderer = NULL; } if (gpWindow != NULL) { SDL_DestroyWindow(gpWindow); gpWindow = NULL; } }
static VALUE RUDL_at_exit(VALUE obj) { DEBUG_S("Reached RUDL_at_exit"); #ifdef HAVE_SDL_NET_H quitNet(); #endif quitJoystick(); #ifdef HAVE_SDL_MIXER_H quitAudio(); #endif quitVideo(); quitTTF(); DEBUG_S("Quitting the rest of it"); SDL_Quit(); return Qnil; }