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
a0f7e92e40
commit
e223b20cbd
@ -1005,19 +1005,14 @@ module.exports = function(RED) {
|
||||
|
||||
node.on('close', function(done) {
|
||||
node.disconnect(function() {
|
||||
if(node.client) {
|
||||
node._clientRemoveListeners();
|
||||
}
|
||||
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 {function} handler The handler for this event
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user