|
@@ -64,10 +64,11 @@ Application::Application(Context* context) :
|
|
|
|
|
|
|
|
int Application::Run()
|
|
int Application::Run()
|
|
|
{
|
|
{
|
|
|
-#if !defined(EMSCRIPTEN) // TODO: do we really need to do this?
|
|
|
|
|
|
|
+ // Emscripten-specific: C++ exceptions are turned off by default in -O1 (and above), unless '-s DISABLE_EXCEPTION_CATCHING=0' flag is set
|
|
|
|
|
+ // Urho3D build configuration uses -O3 (Release), -O2 (RelWithDebInfo), and -O0 (Debug)
|
|
|
|
|
+ // Thus, the try-catch block below should be optimised out except in Debug build configuration
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
-#endif
|
|
|
|
|
Setup();
|
|
Setup();
|
|
|
if (exitCode_)
|
|
if (exitCode_)
|
|
|
return exitCode_;
|
|
return exitCode_;
|
|
@@ -99,14 +100,12 @@ int Application::Run()
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
return exitCode_;
|
|
return exitCode_;
|
|
|
-#if !defined(EMSCRIPTEN)
|
|
|
|
|
}
|
|
}
|
|
|
catch (std::bad_alloc&)
|
|
catch (std::bad_alloc&)
|
|
|
{
|
|
{
|
|
|
ErrorDialog(GetTypeName(), "An out-of-memory error occurred. The application will now exit.");
|
|
ErrorDialog(GetTypeName(), "An out-of-memory error occurred. The application will now exit.");
|
|
|
return EXIT_FAILURE;
|
|
return EXIT_FAILURE;
|
|
|
}
|
|
}
|
|
|
-#endif
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void Application::ErrorExit(const String& message)
|
|
void Application::ErrorExit(const String& message)
|