mirror of
https://github.com/nodemcu/nodemcu-firmware.git
synced 2025-01-16 20:52:57 +08:00
Initialize cb for unsubscribe and unref it upon socket deletion. (#1305)
Thank you.
This commit is contained in:
parent
ab6c2c3924
commit
2bb6e407a3
@ -674,6 +674,7 @@ static int mqtt_socket_client( lua_State* L )
|
|||||||
|
|
||||||
mud->cb_message_ref = LUA_NOREF;
|
mud->cb_message_ref = LUA_NOREF;
|
||||||
mud->cb_suback_ref = LUA_NOREF;
|
mud->cb_suback_ref = LUA_NOREF;
|
||||||
|
mud->cb_unsuback_ref = LUA_NOREF;
|
||||||
mud->cb_puback_ref = LUA_NOREF;
|
mud->cb_puback_ref = LUA_NOREF;
|
||||||
mud->pesp_conn = NULL;
|
mud->pesp_conn = NULL;
|
||||||
#ifdef CLIENT_SSL_ENABLE
|
#ifdef CLIENT_SSL_ENABLE
|
||||||
@ -842,6 +843,8 @@ static int mqtt_delete( lua_State* L )
|
|||||||
mud->cb_message_ref = LUA_NOREF;
|
mud->cb_message_ref = LUA_NOREF;
|
||||||
luaL_unref(L, LUA_REGISTRYINDEX, mud->cb_suback_ref);
|
luaL_unref(L, LUA_REGISTRYINDEX, mud->cb_suback_ref);
|
||||||
mud->cb_suback_ref = LUA_NOREF;
|
mud->cb_suback_ref = LUA_NOREF;
|
||||||
|
luaL_unref(L, LUA_REGISTRYINDEX, mud->cb_unsuback_ref);
|
||||||
|
mud->cb_unsuback_ref = LUA_NOREF;
|
||||||
luaL_unref(L, LUA_REGISTRYINDEX, mud->cb_puback_ref);
|
luaL_unref(L, LUA_REGISTRYINDEX, mud->cb_puback_ref);
|
||||||
mud->cb_puback_ref = LUA_NOREF;
|
mud->cb_puback_ref = LUA_NOREF;
|
||||||
lua_gc(L, LUA_GCSTOP, 0);
|
lua_gc(L, LUA_GCSTOP, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user