Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AppFactory::ExitMainThread(EMainErrorFlag err_flag, IAuxExitParam err_opt)
- {
- printf("ExitMainThread() called...\n");
- // Call minidump is fatal or unexpected
- if ( AUX_HAS_FLAG(err_flag, E_MAIN_ERROR_FLAG_IS_FATAL) || !AUX_HAS_FLAG(err_flag, E_MAIN_ERROR_FLAG_EXPECTED))
- {
- Debug::MiniDump::WriteMinidump();
- }
- // Wait...
- if ( AUX_HAS_FLAG(err_flag, E_MAIN_ERROR_FLAG_SUSPENDED) )
- {
- Sleep(err_opt.timeout);
- }
- // Announce (Maybe window has been closed, before anyone can read that shit? :)
- if ( AUX_HAS_FLAG(err_flag, E_MAIN_ERROR_FLAG_ANNOUNCED) )
- {
- AUX_ASSERT(0 != err_opt.exit_message);
- ShowError(false, "Application call exit, due to: %s", err_opt.exit_message);
- }
- #if AUX__WINDOWS
- // shutdown the C runtime, this cleans up static objects but doesn't shut
- // down the process
- _cexit();
- // finally terminate the process
- ExitProcess(err_opt.error_code);
- #else // posix
- exit(err_opt.error_code);
- #endif
- }
Add Comment
Please, Sign In to add comment