Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 4, 2015, 10:32:52 PM (9 years ago)
Author:
landauf
Message:

unload graphics when the game exits

File:
1 edited

Legend:

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

    r10520 r10524  
    309309
    310310        // Any exception should trigger this, even in upgradeToGraphics (see its remarks)
    311         Loki::ScopeGuard unloader = Loki::MakeObjGuard(*this, &Core::unloadGraphics);
     311        Loki::ScopeGuard unloader = Loki::MakeObjGuard(*this, &Core::unloadGraphics, true);
    312312
    313313        // Upgrade OGRE to receive a render window
     
    357357    }
    358358
    359     void Core::unloadGraphics()
     359    void Core::unloadGraphics(bool loadGraphicsManagerWithoutRenderer)
    360360    {
    361361        orxout(internal_info) << "unloading graphics in Core" << endl;
     
    368368        // Load Ogre::Root again, but without the render system
    369369        try
    370             { this->graphicsManager_ = new GraphicsManager(false); }
     370        {
     371            if (loadGraphicsManagerWithoutRenderer)
     372                this->graphicsManager_ = new GraphicsManager(false);
     373        }
    371374        catch (...)
    372375        {
Note: See TracChangeset for help on using the changeset viewer.