Guest User

Untitled

a guest
Nov 24th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. void AppFactory::ExitMainThread(EMainErrorFlag err_flag, IAuxExitParam err_opt)
  2. {
  3. printf("ExitMainThread() called...\n");
  4.  
  5. // Call minidump is fatal or unexpected
  6. if ( AUX_HAS_FLAG(err_flag, E_MAIN_ERROR_FLAG_IS_FATAL) || !AUX_HAS_FLAG(err_flag, E_MAIN_ERROR_FLAG_EXPECTED))
  7. {
  8. Debug::MiniDump::WriteMinidump();
  9. }
  10.  
  11. // Wait...
  12. if ( AUX_HAS_FLAG(err_flag, E_MAIN_ERROR_FLAG_SUSPENDED) )
  13. {
  14. Sleep(err_opt.timeout);
  15. }
  16.  
  17. // Announce (Maybe window has been closed, before anyone can read that shit? :)
  18. if ( AUX_HAS_FLAG(err_flag, E_MAIN_ERROR_FLAG_ANNOUNCED) )
  19. {
  20. AUX_ASSERT(0 != err_opt.exit_message);
  21. ShowError(false, "Application call exit, due to: %s", err_opt.exit_message);
  22. }
  23.  
  24. #if AUX__WINDOWS
  25. // shutdown the C runtime, this cleans up static objects but doesn't shut
  26. // down the process
  27. _cexit();
  28.  
  29. // finally terminate the process
  30. ExitProcess(err_opt.error_code);
  31. #else // posix
  32. exit(err_opt.error_code);
  33. #endif
  34. }
Add Comment
Please, Sign In to add comment