1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

fix for BUS holding after onClose

This commit is contained in:
cTn 2013-06-19 13:06:14 +02:00
parent 52e46bd9e2
commit a42a464d1f
3 changed files with 22 additions and 0 deletions

View file

@ -6,5 +6,15 @@ chrome.app.runtime.onLaunched.addListener(function() {
maxWidth: 960,
minHeight: 600,
maxHeight: 600
}, function(window_child) {
window_child.onClosed.addListener(function() {
// connectionId is passed from the script side through the chrome.runtime.getBackgroundPage refference
// allowing us to automatically close the port when application shut down
if (connectionId != -1) {
chrome.serial.close(connectionId, function(){
console.log('CLEANUP: Connection to serial port was opened after application closed, closing the connection.');
});
}
});
});
});