修复App::destory函数造成内存泄漏的bug
This commit is contained in:
parent
4462834c3c
commit
a7e82b6801
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue