修复App::destory函数造成内存泄漏的bug

This commit is contained in:
Nomango 2017-10-05 11:36:15 +08:00
parent 4462834c3c
commit a7e82b6801
2 changed files with 4 additions and 3 deletions

View File

@ -393,7 +393,8 @@ void App::free()
void App::destory() void App::destory()
{ {
// 释放所有内存 // 释放所有内存
free(); s_pInstance->free();
// 实例指针置空 // 实例指针置空
delete s_pInstance;
s_pInstance = nullptr; s_pInstance = nullptr;
} }

View File

@ -131,8 +131,6 @@ public:
int run(); int run();
// 释放所有内存资源 // 释放所有内存资源
void free(); void free();
// 销毁该对象
void destory();
// 获取程序实例 // 获取程序实例
static App * get(); static App * get();
@ -178,6 +176,8 @@ public:
static void reset(); static void reset();
// 获取当前场景 // 获取当前场景
static Scene * getCurrentScene(); static Scene * getCurrentScene();
// 销毁该对象
static void destory();
protected: protected:
TString m_sTitle; TString m_sTitle;