[Orxonox-commit 3175] r7868 - code/trunk/src/libraries/core
landauf at orxonox.net
landauf at orxonox.net
Sat Feb 12 16:28:53 CET 2011
Author: landauf
Date: 2011-02-12 16:28:53 +0100 (Sat, 12 Feb 2011)
New Revision: 7868
Modified:
code/trunk/src/libraries/core/Core.cc
code/trunk/src/libraries/core/GraphicsManager.cc
Log:
use exit() instead of abort() if the ogre config dialog was canceled by the user. avoids error/crash message.
Modified: code/trunk/src/libraries/core/Core.cc
===================================================================
--- code/trunk/src/libraries/core/Core.cc 2011-02-12 14:32:12 UTC (rev 7867)
+++ code/trunk/src/libraries/core/Core.cc 2011-02-12 15:28:53 UTC (rev 7868)
@@ -250,6 +250,12 @@
{
graphicsManager_->upgradeToGraphics();
}
+ catch (const InitialisationFailedException& e)
+ {
+ // Exit the application if the Ogre config dialog was canceled
+ COUT(1) << Exception::handleMessage() << std::endl;
+ exit(EXIT_FAILURE);
+ }
catch (...)
{
// Recovery from this is very difficult. It requires to completely
@@ -258,7 +264,7 @@
// throws an exception and the graphics engine then gets destroyed
// and reloaded between throw and catch (access violation in MSVC).
// That's why we abort completely and only display the exception.
- COUT(0) << "An exception occurred during upgrade to graphics. "
+ COUT(1) << "An exception occurred during upgrade to graphics. "
<< "That is unrecoverable. The message was:" << endl
<< Exception::handleMessage() << endl;
abort();
Modified: code/trunk/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/trunk/src/libraries/core/GraphicsManager.cc 2011-02-12 14:32:12 UTC (rev 7867)
+++ code/trunk/src/libraries/core/GraphicsManager.cc 2011-02-12 15:28:53 UTC (rev 7868)
@@ -304,7 +304,7 @@
if (!ogreRoot_->restoreConfig())
if (!ogreRoot_->showConfigDialog())
- ThrowException(InitialisationFailed, "OGRE graphics configuration dialogue failed.");
+ ThrowException(InitialisationFailed, "OGRE graphics configuration dialogue canceled.");
CCOUT(4) << "Creating render window" << std::endl;
More information about the Orxonox-commit
mailing list