Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
2bb6e407
Commit
2bb6e407
authored
May 21, 2016
by
Arnim Läuger
Committed by
Philip Gladstone
May 21, 2016
Browse files
Initialize cb for unsubscribe and unref it upon socket deletion. (#1305)
Thank you.
parent
ab6c2c39
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/mqtt.c
View file @
2bb6e407
...
@@ -674,6 +674,7 @@ static int mqtt_socket_client( lua_State* L )
...
@@ -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 )
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment