summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--c++.html.markdown5
1 files changed, 4 insertions, 1 deletions
diff --git a/c++.html.markdown b/c++.html.markdown
index 1cf5508a..b59635f5 100644
--- a/c++.html.markdown
+++ b/c++.html.markdown
@@ -349,7 +349,10 @@ public:
// These are called when an object is deleted or falls out of scope.
// This enables powerful paradigms such as RAII
// (see below)
- // Destructors must be virtual to allow classes to be derived from this one.
+ // Destructors should be virtual if a class is to be derived from;
+ // if they are not virtual, then any resources allocated using RAII in
+ // the derived class will not be released if it destroyed through a
+ // base-class reference or pointer.
virtual ~Dog();
}; // A semicolon must follow the class definition.