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