From e0e7d0703bb009fc7b1b5761817b34fa5263d6bf Mon Sep 17 00:00:00 2001 From: "ithink.chan" Date: Wed, 26 Jun 2019 15:10:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=8B=E7=BB=8D=20Cpp=20=E6=9E=90=E6=9E=84?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=99=9A=E6=9E=90?= =?UTF-8?q?=E6=9E=84=E5=87=BD=E6=95=B0=E7=9A=84=E8=AF=B4=E6=98=8E=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ithink.chan --- Software/Program/Language/Cpp/Cpp_析构方法.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Software/Program/Language/Cpp/Cpp_析构方法.md diff --git a/Software/Program/Language/Cpp/Cpp_析构方法.md b/Software/Program/Language/Cpp/Cpp_析构方法.md new file mode 100644 index 0000000..2b44130 --- /dev/null +++ b/Software/Program/Language/Cpp/Cpp_析构方法.md @@ -0,0 +1,3 @@ +# Cpp 析构方法 + +基类带有虚函数的,最好提供一个虚析构函数,并且子类重载这个虚构函数,否则将基类指针指向子类后,再去 delete 这个指针将导致内存泄漏。