<!DOCTYPE qhelp PUBLIC
  "-//Semmle//qhelp//EN"
  "qhelp.dtd">
<qhelp>


<overview>
<p>This rule finds classes that define a non-virtual destructor, yet they have derived classes that also define a non-virtual destructor. 
This can prevent proper cleanup of resources as only the destructor of the type of the variable will be called (instead of the type of the 
object instance).</p>

</overview>
<recommendation>
<p>Make the destructor virtual.</p>

</recommendation>
<example><sample src="NonVirtualDestructor.cpp" />



</example>
<references>
<li>R. Chen, <a href="http://blogs.msdn.com/oldnewthing/archive/2004/05/07/127826.aspx">When should your destructor be virtual?</a>.</li>
<li>S. Meyers. <em>Effective C++ 3d ed.</em> pp 40-44. Addison-Wesley Professional, 2005.</li>
</references>
</qhelp>
