添加释放单例语言包对象
This commit is contained in:
parent
bcf44cada0
commit
b9f0123917
|
@ -552,6 +552,7 @@ class lang_mgr
|
|||
}
|
||||
~lang_mgr()
|
||||
{
|
||||
clear();
|
||||
delete[](char*)all_;
|
||||
}
|
||||
|
||||
|
@ -593,8 +594,6 @@ public:
|
|||
|
||||
return cp;
|
||||
}
|
||||
|
||||
public:
|
||||
static lang_mgr* instance(void)
|
||||
{
|
||||
if (!lang_mgr::inst_)
|
||||
|
@ -602,6 +601,16 @@ public:
|
|||
|
||||
return lang_mgr::inst_;
|
||||
}
|
||||
static void destroy(void)
|
||||
{
|
||||
if (lang_mgr::inst_)
|
||||
{
|
||||
delete lang_mgr::inst_;
|
||||
lang_mgr::inst_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
int get_cur_cp(void)
|
||||
{
|
||||
return cur_cp_;
|
||||
|
@ -764,6 +773,11 @@ public:
|
|||
};
|
||||
lang_mgr* lang_mgr::inst_ = nullptr;
|
||||
|
||||
void clear_language_data(void)
|
||||
{
|
||||
lang_mgr::destroy();
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
int lang_initialize(void* param)
|
||||
|
|
Loading…
Reference in New Issue