mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
mraa-gpio: clean up on close for ain, pwm, dout
Required as nodejs will only lazily delete the node objects, and we may race with the next user requesting the resources. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com>
This commit is contained in:
parent
7050f0a147
commit
24079943b3
@ -25,6 +25,7 @@ module.exports = function(RED) {
|
||||
|
||||
this.on('close', function() {
|
||||
clearInterval(this.timer);
|
||||
node.x.close();
|
||||
});
|
||||
}
|
||||
RED.nodes.registerType("mraa-gpio-ain", gpioAin);
|
||||
|
@ -29,6 +29,7 @@ module.exports = function(RED) {
|
||||
});
|
||||
|
||||
this.on('close', function() {
|
||||
node.p.close();
|
||||
});
|
||||
}
|
||||
RED.nodes.registerType("mraa-gpio-dout", gpioDout);
|
||||
|
@ -21,6 +21,7 @@ module.exports = function(RED) {
|
||||
|
||||
this.on('close', function() {
|
||||
node.p.enable(false);
|
||||
node.p.close();
|
||||
});
|
||||
}
|
||||
RED.nodes.registerType("mraa-gpio-pwm", gpioPWM);
|
||||
|
Loading…
x
Reference in New Issue
Block a user