Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef OGRE_EXCEPT
- #define OGRE_EXCEPT(num, desc, src) \
- throw Ogre::ExceptionFactory::create( \
- Ogre::ExceptionCodeType<num>(), desc, \
- src, __FILE__, __LINE__ );
- #endif
- ArchiveManager::~ArchiveManager()
- {
- // Unload & delete resources in turn
- for( ArchiveMap::iterator it = mArchives.begin();
- it != mArchives.end(); ++it )
- {
- Archive* arch = it->second;
- // Unload
- arch->unload();
- // Find factory to destroy
- ArchiveFactoryMap::iterator fit =
- mArchFactories.find(arch->getType());
- if (fit == mArchFactories.end())
- {
- // Factory not found
- OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND,
- "Cannot find an archive factory "
- "to deal with archive of type " +
- arch->getType(),
- "ArchiveManager::~ArchiveManager");
- }
- fit->second->destroyInstance(arch);
- }
- // Empty the list
- mArchives.clear();
- }
- This suspicious code was found in OGRE project by PVS-Studio static code analyzer.
- Warning message is:
- V509 The 'throw' operator inside the destructor should be placed within the try..catch block. Raising exception inside the destructor is illegal. OgreMain ogrearchivemanager.cpp 124
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement