From 73c109dfc46e332a9ef12c70af95bc216e8fd5bb Mon Sep 17 00:00:00 2001 From: shewer Date: Wed, 25 Oct 2023 16:17:44 +0800 Subject: [PATCH] =?UTF-8?q?fix=20memory=20dump=20:=20memories=5Fcallback?= =?UTF-8?q?=20=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shewer --- src/script_translator.cc | 3 ++- src/table_translator.cc | 2 ++ src/types_ext.cc | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/script_translator.cc b/src/script_translator.cc index 95b0862..10ff48a 100644 --- a/src/script_translator.cc +++ b/src/script_translator.cc @@ -44,7 +44,7 @@ class LScriptTranslator : public ScriptTranslator { protected: Lua* lua_; - an memorize_callback_ = {}; + an memorize_callback_; string schema_id_; }; @@ -71,6 +71,7 @@ bool LScriptTranslator::memorize(const CommitEntry& commit_entry) { LScriptTranslator::LScriptTranslator(const Ticket& ticket, Lua* lua) : lua_(lua), ScriptTranslator(ticket), schema_id_(ticket.schema->schema_id()){ + memorize_callback_ = lua_->getglobal("___"); } void LScriptTranslator::set_enable_correction(bool enable) { diff --git a/src/table_translator.cc b/src/table_translator.cc index dc556e1..0e04308 100644 --- a/src/table_translator.cc +++ b/src/table_translator.cc @@ -83,6 +83,8 @@ bool LTableTranslator::memorize(const CommitEntry& commit_entry) { LTableTranslator::LTableTranslator(const Ticket& ticket, Lua* lua) : lua_(lua), TableTranslator(ticket), schema_id_(ticket.schema->schema_id()){ + + memorize_callback_ = lua_->getglobal("___"); bool disable_userdict; Config* config = ticket.schema->config(); config->GetBool(name_space_ + "/disable_userdict", &disable_userdict); diff --git a/src/types_ext.cc b/src/types_ext.cc index ad636f7..83ac464 100644 --- a/src/types_ext.cc +++ b/src/types_ext.cc @@ -13,8 +13,6 @@ #include #include #include -#include "table_translator.h" -#include "script_translator.h" #include "lib/lua_export_type.h" #include "lib/luatype_boost_optional.h"