添加释放单例语言包对象

This commit is contained in:
gb 2023-08-08 19:41:48 +08:00
parent bcf44cada0
commit b9f0123917
1 changed files with 16 additions and 2 deletions

View File

@ -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)