1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-22 07:45:29 +03:00

polishing serial backend and background page

This commit is contained in:
cTn 2013-12-06 18:32:32 +01:00
parent 49317da015
commit a81cdb6d9d
3 changed files with 13 additions and 18 deletions

View file

@ -10,9 +10,9 @@ function start_app() {
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.');
if (app_window.connectionId > 0) {
chrome.serial.close(app_window.connectionId, function(result) {
console.log('SERIAL: Connection closed - ' + result);
});
}
});