PVS-StudioWarnings

PVS-Studio warning V599 for Synergy

Nov 13th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. class CKeyMap {
  2. public:
  3.   CKeyMap();
  4.   ~CKeyMap();
  5.   ....
  6.   virtual void swap(CKeyMap&);
  7.   virtual void addHalfDuplexModifier(KeyID key);
  8.   virtual void finish();
  9.   ....
  10. };
  11.  
  12. class CMockKeyMap : public CKeyMap { .... };
  13.  
  14. CKeyMap* m_keyMapPtr;
  15.  
  16. CKeyState::~CKeyState()
  17. {
  18.   if (m_keyMapPtr)
  19.     delete m_keyMapPtr;
  20. }
  21.  
  22. This suspicious code was found in Synergy project by PVS-Studio static code analyzer.
  23. Warning message is:
  24. V599 The destructor was not declared as a virtual one, although the 'CKeyMap' class contains virtual functions. ckeystate.cpp 408
  25.  
  26. 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