why use virtual destructor in inheritance
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/461203/when-to-use-virtual-destructors">When to use virtual destructors?</a>  </p>
</blockquote>



<p>let's say i have an abstract class Animal</p>

<pre><code>class Animal {
public:
    Animal(const std::string &amp;name) : _name(name)
    {
    }
    virtual void Print() const = 0;
    virtual ~Animal() {}
protected:
    std::string _name;
};
</code></pre>

<p>and i have Dog and Cat that inherit this class.
In a book i'm reading it is recommended to define a virtual destructor in base-class.
I tried to create objects without the definition of virtual des' and the program runs fine, without leaks (checked with valgrind).
So my question is why use virtual destructor (with empty implementation)? what is the benefit from it?</p>

<p>thank you! </p>
