You need to sign in or sign up before continuing.
Commit 2bb6e407 authored by Arnim Läuger's avatar Arnim Läuger Committed by Philip Gladstone
Browse files

Initialize cb for unsubscribe and unref it upon socket deletion. (#1305)

Thank you.
parent ab6c2c39
......@@ -674,6 +674,7 @@ static int mqtt_socket_client( lua_State* L )
mud->cb_message_ref = LUA_NOREF;
mud->cb_suback_ref = LUA_NOREF;
mud->cb_unsuback_ref = LUA_NOREF;
mud->cb_puback_ref = LUA_NOREF;
mud->pesp_conn = NULL;
#ifdef CLIENT_SSL_ENABLE
......@@ -842,6 +843,8 @@ static int mqtt_delete( lua_State* L )
mud->cb_message_ref = LUA_NOREF;
luaL_unref(L, LUA_REGISTRYINDEX, mud->cb_suback_ref);
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);
mud->cb_puback_ref = LUA_NOREF;
lua_gc(L, LUA_GCSTOP, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment