Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Only catch exceptions you actually expect. And rethrow unknown exceptions ("…" can also catch internal Microsoft exceptions like floating point exception).

File:
1 edited

Legend:

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

    r6746 r7174  
    306306                continue;
    307307            const std::string& className = device->getClassName();
    308             try
    309             {
    310                 delete device;
    311                 device = 0;
    312                 CCOUT(4) << className << " destroyed." << std::endl;
    313             }
    314             catch (...)
    315             {
    316                 COUT(1) << className << " destruction failed: " << Exception::handleMessage() << std::endl
    317                         << "    Potential resource leak!" << std::endl;
    318             }
     308            delete device;
     309            device = 0;
     310            CCOUT(4) << className << " destroyed." << std::endl;
    319311        }
    320312        devices_.resize(InputDeviceEnumerator::FirstJoyStick);
     
    325317            OIS::InputManager::destroyInputSystem(oisInputManager_);
    326318        }
    327         catch (...)
    328         {
    329             COUT(1) << "OIS::InputManager destruction failed" << Exception::handleMessage() << std::endl
     319        catch (const OIS::Exception& ex)
     320        {
     321            COUT(1) << "OIS::InputManager destruction failed" << ex.eText << std::endl
    330322                    << "    Potential resource leak!" << std::endl;
    331323        }
Note: See TracChangeset for help on using the changeset viewer.