From a7e82b68014cc91320adf4643fcf661b966f0a5d Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Thu, 5 Oct 2017 11:36:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DApp::destory=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E9=80=A0=E6=88=90=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Easy2D/Base/App.cpp | 3 ++- Easy2D/easy2d.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Easy2D/Base/App.cpp b/Easy2D/Base/App.cpp index 1147e6fd..9ba8dc8a 100644 --- a/Easy2D/Base/App.cpp +++ b/Easy2D/Base/App.cpp @@ -393,7 +393,8 @@ void App::free() void App::destory() { // 释放所有内存 - free(); + s_pInstance->free(); // 实例指针置空 + delete s_pInstance; s_pInstance = nullptr; } diff --git a/Easy2D/easy2d.h b/Easy2D/easy2d.h index d48e7309..baefba3f 100644 --- a/Easy2D/easy2d.h +++ b/Easy2D/easy2d.h @@ -131,8 +131,6 @@ public: int run(); // 释放所有内存资源 void free(); - // 销毁该对象 - void destory(); // 获取程序实例 static App * get(); @@ -178,6 +176,8 @@ public: static void reset(); // 获取当前场景 static Scene * getCurrentScene(); + // 销毁该对象 + static void destory(); protected: TString m_sTitle;