diff --git a/src/localstorage.cpp b/src/localstorage.cpp index 6ac9ca6..c7521f7 100644 --- a/src/localstorage.cpp +++ b/src/localstorage.cpp @@ -47,7 +47,7 @@ void module::local_storage::regist(sol::state* lua) ); } -void module::local_storage::regist_global(const std::string& name, sol::state* lua) +void module::local_storage::regist_global(const char* name, sol::state* lua) { lua->registry()[name] = this; (*lua)[name] = this; diff --git a/src/localstorage.h b/src/localstorage.h index 1b810ed..f44aeee 100644 --- a/src/localstorage.h +++ b/src/localstorage.h @@ -20,7 +20,7 @@ namespace module static void regist(sol::state* lua); private: // 通过 imodule 继承 - virtual void regist_global(const std::string& name, sol::state* lua); + virtual void regist_global(const char* name, sol::state* lua); virtual void delete_global() { delete this; } }; }