PVS-StudioWarnings

PVS-Studio warning V599 for MTASA

Nov 17th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. class CKeyBind
  2. {
  3.   //A virtual destructor is absent
  4.   ....
  5. };
  6.  
  7. class CKeyBindWithState: public CKeyBind { .... };
  8. class CGTAControlBind: public CKeyBind { .... };
  9.  
  10. void CKeyBinds::Remove ( CKeyBind* pKeyBind )
  11. {
  12.   if ( m_bProcessingKeyStroke ) pKeyBind->beingDeleted = true;
  13.   else
  14.   {
  15.     m_pList->remove ( pKeyBind );
  16.     delete pKeyBind;
  17.   }
  18. }
  19.  
  20. This suspicious code was found in MTASA project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V599 The virtual destructor is not present, although the 'CKeyBind' class contains virtual functions. ckeybinds.cpp 488
  23.  
  24. 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