void Application::ErrorExit(const String& message) { engine_->Exit(); // Close the rendering window exitCode_ = EXIT_FAILURE; // Only for WIN32, otherwise the last message would be double posted on Mac OS X and Linux platforms if (!message.Length()) { #ifdef WIN32 Log* log = GetSubsystem<Log>(); // May be null if ENABLE_LOGGING is not defined during build ErrorDialog(GetTypeName(), log ? log->GetLastMessage() : "Application has been terminated due to unexpected error."); #endif } else ErrorDialog(GetTypeName(), message); }