bugfix / cleanup routine for delayed data
requests that could leak into CLI and cause corruption10.3.x-maintenance
parent
238f18b5c5
commit
88ed454169
13
js/msp.js
13
js/msp.js
|
@ -67,17 +67,20 @@ var MSP = {
|
|||
callbacks: [],
|
||||
packet_error: 0,
|
||||
|
||||
disconnect_cleanup: function() {
|
||||
this.state = 0; // reset packet state for "clean" initial entry (this is only required if user hot-disconnects)
|
||||
this.packet_error = 0; // reset CRC packet error counter for next session
|
||||
|
||||
// kill all "raw" MSP timers
|
||||
callbacks_cleanup: function() {
|
||||
for (var i = 0; i < this.callbacks.length; i++) {
|
||||
clearInterval(this.callbacks[i].timer);
|
||||
}
|
||||
|
||||
// drop references
|
||||
this.callbacks = [];
|
||||
},
|
||||
|
||||
disconnect_cleanup: function() {
|
||||
this.state = 0; // reset packet state for "clean" initial entry (this is only required if user hot-disconnects)
|
||||
this.packet_error = 0; // reset CRC packet error counter for next session
|
||||
|
||||
this.callbacks_cleanup();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -27,6 +27,9 @@ function tab_initialize_cli() {
|
|||
$('#content').load("./tabs/cli.html", function() {
|
||||
GUI.active_tab = 'cli';
|
||||
|
||||
// remove any active interval for delayed command
|
||||
MSP.callbacks_cleanup();
|
||||
|
||||
CLI_active = true;
|
||||
|
||||
// Enter CLI mode
|
||||
|
|
Loading…
Reference in New Issue