PVS-StudioWarnings

PVS-Studio warning V509 for Source SDK

Nov 12th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. CRecordEffectOwner::~CRecordEffectOwner()
  2. {
  3.   if ( m_bToolsEnabled )
  4.   {
  5.     KeyValues *msg = new KeyValues( "EffectsOwner" );
  6.     ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
  7.     msg->deleteThis();
  8.   }
  9. }
  10.  
  11. This suspicious code was found in Source SDK project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. 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
  14.  
  15. 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