Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7175


Ignore:
Timestamp:
Aug 18, 2010, 12:12:42 AM (14 years ago)
Author:
rgrieder
Message:

Fixed a problem with Ogre 1.7 and our exception handling mechanism. Somehow Ogre exceptions don't like if you completely reload Ogre during throw and catch…
The fix is simple: Abort the program if graphics loading fails (but display the exception message).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/Core.cc

    r7167 r7175  
    229229
    230230        // Upgrade OGRE to receive a render window
    231         graphicsManager_->upgradeToGraphics();
     231        try
     232        {
     233            graphicsManager_->upgradeToGraphics();
     234        }
     235        catch (...)
     236        {
     237            // Recovery from this is very difficult. It requires to completely
     238            // destroy Ogre related objects and load again (without graphics).
     239            // However since Ogre 1.7 there seems to be a problem when Ogre
     240            // throws an exception and the graphics engine then gets destroyed
     241            // and reloaded between throw and catch (access violation in MSVC).
     242            // That's why we abort completely and only display the exception.
     243            COUT(0) << "An exception occurred during upgrade to graphics. "
     244                    << "That is unrecoverable. The message was:" << endl
     245                    << Exception::handleMessage() << endl;
     246            abort();
     247        }
    232248
    233249        // Calls the InputManager which sets up the input devices.
Note: See TracChangeset for help on using the changeset viewer.