mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Remove unnecessary call to clientRemoveListeners
Also, merge the non JSDOC comment into the JSDOC comment
This commit is contained in:
parent
2ded07c765
commit
e7f6549cb6
@ -922,19 +922,14 @@ module.exports = function(RED) {
|
|||||||
|
|
||||||
node.on('close', function(done) {
|
node.on('close', function(done) {
|
||||||
node.disconnect(function() {
|
node.disconnect(function() {
|
||||||
if(node.client) {
|
|
||||||
node._clientRemoveListeners();
|
|
||||||
}
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Helper functions to track the event listners we add to the
|
|
||||||
// client. The mqtt client also uses it own set of listeners
|
|
||||||
// so we can't use removeAllListeners() wothout breaking it
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an event handler to the MQTT.js client
|
* Add event handlers to the MQTT.js client and track them so that
|
||||||
|
* we do not remove any handlers that the MQTT client uses internally.
|
||||||
|
* Use {@link node._clientRemoveListeners `node._clientRemoveListeners`} to remove handlers
|
||||||
* @param {string} event The name of the event
|
* @param {string} event The name of the event
|
||||||
* @param {function} handler The handler for this event
|
* @param {function} handler The handler for this event
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user