mraa-gpio-din: add cleanup on close

Required as nodejs will only lazily delete the node objects, and we may
race with the next user requesting the resources. ISR thread release.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com>
This commit is contained in:
Ivan Mikhaylov 2022-07-07 14:14:33 -04:00
parent 6790e95bbb
commit f2d3c650b3

View File

@ -50,6 +50,8 @@ module.exports = function(RED) {
}
this.on('close', function() {
node.x.isr(m.EDGE_BOTH, null);
node.x.isrExit();
node.x.close();
});
}
RED.nodes.registerType("mraa-gpio-din", gpioDin);