V509. Exceptions that were raised inside noexcept functions must be wrapped in a try..catch block.
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
#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();
}
V509 The 'throw' operator inside the destructor should be placed within the try..catch block. Raising exception inside the destructor is illegal. cachefileoutbuffer.cpp 52
CCacheFileOutBuffer::~CCacheFileOutBuffer()
{
if (IsOpen())
{
streamOffsets.push_back (GetFileSize());
size_t lastOffset = streamOffsets[0];
for (size_t i = 1,
count = streamOffsets.size();
i < count; ++i)
{
size_t offset = streamOffsets[i];
size_t size = offset - lastOffset;
if (size >= (DWORD)(-1))
throw CStreamException("stream too large");
Add ((DWORD)size);
lastOffset = offset;
}
Add ((DWORD)(streamOffsets.size()-1));
}
}
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. nodeperfview.cpp 109
CNodePerfView::~CNodePerfView()
{
WorkerTask *pTask;
while((pTask = (WorkerTask *)m_workerQueue.Get()) != NULL)
delete pTask;
m_workerQueue.Put(new WorkerTask(NULL, TASK_SHUTDOWN));
ThreadJoin(m_hWorkerThread);
safe_free(m_pGraphList);
}
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. prerender_contents.cc 382
PrerenderContents::~PrerenderContents() {
....
for (....)
{
content::RenderProcessHost* host =
host_iterator.GetCurrentValue();
host->Send(
new PrerenderMsg_OnPrerenderRemoveAliases(alias_urls_));
}
....
}
Similar errors can be found in some other places:
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. _G4FR-archive g4thitscollection.hh 161
template <class T> G4THitsCollection<T>::~G4THitsCollection()
{
if (!anHCAllocator_G4MT_TLS_) anHCAllocator_G4MT_TLS_ =
new G4Allocator<G4HitsCollection>;
std::vector<T*> * theHitsCollection =
(std::vector<T*>*)theCollection;
//theHitsCollection->clearAndDestroy();
for(size_t i=0;i<theHitsCollection->size();i++)
{ delete (*theHitsCollection)[i]; }
theHitsCollection->clear();
delete theHitsCollection;
}
Similar errors can be found in some other places:
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. command_line_interface.cc 479
CommandLineInterface::MemoryOutputStream::~MemoryOutputStream()
{
....
*map_slot = new string;
....
}
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. Client (HL2) particles_new.cpp 92
CNewParticleEffect::~CNewParticleEffect(void)
{
....
KeyValues *msg = new KeyValues( "ParticleSystem_Destroy" );
....
}
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. Client (HL2) toolframework_client.cpp 222
CRecordEffectOwner::~CRecordEffectOwner()
{
if ( m_bToolsEnabled )
{
KeyValues *msg = new KeyValues( "EffectsOwner" );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. sedp.cpp 2456
Sedp::Task::~Task()
{
putq(new Msg(Msg::MSG_STOP, DCPS::GRACEFUL_DISCONNECT, 0));
wait();
}
Similar errors can be found in some other places:
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. renderer.cxx 437
FGRenderer::~FGRenderer()
{
....
getViewer()->setSceneData(new osg::Group);
....
}
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. preservechdir.cpp 43
PreserveChdir::~PreserveChdir()
{
if (originalCurrentDirectory)
{
DWORD len = GetCurrentDirectory(0, NULL);
TCHAR * currentDirectory = new TCHAR[len];
....
}
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. preservechdir.cpp 43
PreserveChdir::~PreserveChdir()
{
....
std::unique_ptr<TCHAR[]> currentDirectory(new TCHAR[len]);
....
}
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. mediapipeline.h 422
~PipelineListener()
{
nsresult rv = NS_DispatchToMainThread(new
ConduitDeleteEvent(conduit_.forget()));
MOZ_ASSERT(....);
if (NS_FAILED(rv)) {
MOZ_CRASH();
}
}
Similar errors can be found in some other places:
V509 The 'new' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. winmtf.cxx 852
WinMtfOutput::~WinMtfOutput()
{
mpGDIMetaFile->AddAction( new MetaPopAction() );
....
}
Similar errors can be found in some other places:
V509 The 'dynamic_cast<T&>' operator should be located inside the try..catch block, as it could potentially generate an exception. Raising exception inside the destructor is illegal. docbm.cxx 846
virtual ~LazyFieldmarkDeleter()
{
dynamic_cast<Fieldmark&>
(*m_pFieldmark.get()).ReleaseDoc(m_pDoc);
}
Similar errors can be found in some other places:
V509 The 'throw' operator inside the destructor should be placed within the try..catch block. Raising exception inside the destructor is illegal. consoleclose.cpp 62
CCtrlHandlerSetter::~CCtrlHandlerSetter()
{
#if !defined(UNDER_CE) && defined(_WIN32)
if (!SetConsoleCtrlHandler(HandlerRoutine, FALSE))
throw "SetConsoleCtrlHandler fails";
#endif
}
This is exactly the case when a reply to a comment turned into a small blog post. The power of ...