On Fri, Nov 20, 2009 at 12:42 PM, Mark Mentovai <m...@chromium.org> wrote:

> As Evan points out, there are some cases when it's not absolutely
> necessary to have a base or interface class declare a virtual
> destructor.


For a concrete example, take AutocompleteEditController, which is declared
in autocomplete_edit.h.  This is an abstract base class that names several
different methods.  The purpose of the class is to insulate the
functionality the edit needs from whatever code actually implements that
functionality.  However, the edit doesn't create or own pointers to its
controller, and never deletes its controller, so this abstract class doesn't
have a virtual destructor.  The pattern here is "implements interface X" as
opposed to the "is a specialized type of an X" pattern of parent and child
classes.

PK

-- 
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev

Reply via email to