From 8f9d966962168ac4f2a07db55345e7fa6b257b80 Mon Sep 17 00:00:00 2001 From: niubinghui Date: Mon, 2 Sep 2024 16:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E7=BA=BF=E7=A8=8B=E5=9C=A8=E4=BF=AE=E6=94=B9=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AAmessage=E6=97=B6=E5=8F=AF=E8=83=BD=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua_binding_functions.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lua_binding_functions.c b/src/lua_binding_functions.c index 77b2058..791a474 100644 --- a/src/lua_binding_functions.c +++ b/src/lua_binding_functions.c @@ -489,6 +489,9 @@ int lua_mq_update_topic(lua_State *state) luaL_unref(state, LUA_REGISTRYINDEX, private_ref); return 0; } +#ifdef LUAPLUGIN_BASIC_UNITTEST + LOGDEBUG("update topic, id %d %d %d", topic_id, private_ref, free_ref); +#endif mq->freemessage_ref = free_ref; mq->mq_private_ref = private_ref; @@ -503,12 +506,15 @@ int lua_mq_update_topic(lua_State *state) lua_rawgeti(state, LUA_REGISTRYINDEX, private_ref); lua_pushlightuserdata(state, (void *)mq); /* stack top new_mq */ lua_setfield(state, -2, LUA_MQ_ENV_DEFAULT_KEY); /* stack top table */ - luaL_unref(state, LUA_REGISTRYINDEX, mq->mq_private_ref); + // luaL_unref(state, LUA_REGISTRYINDEX, mq->mq_private_ref); mq->mq_private_ref = private_ref; - /* 更新free function ref */ - luaL_unref(state, LUA_REGISTRYINDEX, mq->freemessage_ref); + // luaL_unref(state, LUA_REGISTRYINDEX, mq->freemessage_ref); mq->freemessage_ref = free_ref; + +#ifdef LUAPLUGIN_BASIC_UNITTEST + LOGDEBUG("update topic, id %d %d %d", topic_id, private_ref, free_ref); +#endif } lua_settop(state, 0);