bugfix
parent
0ccdc762b4
commit
ed963bfdad
|
@ -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…
Reference in New Issue