Example #1
0
int BaseApp::InternalCleanup()
{
	try
	{
		InternalOnQuit();
		if(!_internal_quitted)
			throw Exception("InternalOnQuit() was not called on BaseApp!");

		OnQuit();
		SaveCfg();
	}
	catch(const std::exception & e)
	{
		InternalOnForceQuit();
		if(!_internal_force_quitted)
			Log::Error("InternalOnForceQuit() was not called on BaseApp!");

		Log::Error("Exception: {}", e.what());
		OnForceQuit();
		system("pause");
		return EXIT_FAILURE;
	}

	return EXIT_SUCCESS;
}
Example #2
0
void UserQuit()
{
   if (gpScreen != NULL)
      SDL_FreeSurface(gpScreen);

   SDL_Quit();

   FreeTextMessage();
   SaveCfg();

   exit(0);
}
Example #3
0
void OnDestroy(AG_Event *event)
{
   // 20120610 GUI関連処理
   bEventRunFlag = FALSE; 
#ifdef _WITH_DEBUGGER
   Detach_DebugMenu();
#endif
   /*
    * サウンド停止
    */
   StopSnd();
   SaveCfg();
   AG_ConfigSave();
   /*
    * コンポーネント クリーンアップ
    */
#ifdef FDDSND
   CleanFDDSnd();
#endif				/*  */
   CleanSch();
   CleanKbd();
   CleanSnd();
   CleanDraw();
   DestroyStatus();

   /*
    * 仮想マシン クリーンアップ
    */
   system_cleanup();
   if(pCpuID != NULL) {
      detachCpuID(pCpuID);
      pCpuID = NULL;
   }


   AG_MutexDestroy(&VMMutex);
//   AG_Destroy();
#if 0 
   muntrace();
#endif
   DiscardTextures(1, &uVramTextureID);
   DiscardTextures(1, &uNullTextureID);
   uVramTextureID = 0;
   XM7_DebugLog(XM7_LOG_INFO, "All resources allocated by VM were freed.");
//   AG_Destroy();
}
Example #4
0
// Fonction de sortie du programme
void eXit(void)
{
  // Sauvegarde des configurations
  SaveCfg();
  // Destruction des objets dynamiques
  // destruction du menu
  if(SkinMenu)
    delete SkinMenu;
  //
  DelJ();

  if(Particule)
    delete Particule;

  if(mapDetail)
    {
      for(int iM=0 ; iM<nbMaps ; iM++)
	{
	  delete mapDetail[iM].tabClimat;
	}
      free(mapDetail);
    }

  clAvaMan::Kill();

  clSoundMan::Kill();

  // Sortie du programme
  logOut("\n  [OK] Destruction terminée ( time : %d )\n\n");//,int(TisT.GetTime()));
  logOut("  sw3..phoenixia(v0.4b)\n\n");

  exit(0);

  return;

}