mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
bugfix
This commit is contained in:
parent
0ccdc762b4
commit
ed963bfdad
1 changed files with 6 additions and 2 deletions
|
@ -7,8 +7,12 @@ 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 (app_window.serial.connectionId > 0) {
|
||||
chrome.serial.disconnect(app_window.serial.connectionId, function(result) {
|
||||
|
||||
// save connectionId in separate variable before app_window is destroyed
|
||||
var connectionId = app_window.serial.connectionId;
|
||||
|
||||
if (connectionId > 0) {
|
||||
chrome.serial.disconnect(connectionId, function(result) {
|
||||
console.log('SERIAL: Connection closed - ' + result);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue