Fix V86.destroy() with xterm.js (#720)
`V86.destroy()` was throwing an error due to `SerialAdapterXtermJS` having no `destroy()` method.
This commit is contained in:
parent
62d967bce0
commit
cb1c3211e9
|
@ -227,7 +227,7 @@ function SerialAdapterXtermJS(element, bus)
|
|||
term["setOption"]("logLevel", "off");
|
||||
term.write("This is the serial console. Whatever you type or paste here will be sent to COM1");
|
||||
|
||||
term["onData"](function(data) {
|
||||
const on_data_disposable = term["onData"](function(data) {
|
||||
for(let i = 0; i < data.length; i++)
|
||||
{
|
||||
bus.send("serial0-input", data.charCodeAt(i));
|
||||
|
@ -238,6 +238,11 @@ function SerialAdapterXtermJS(element, bus)
|
|||
{
|
||||
term.write(chr);
|
||||
}, this);
|
||||
|
||||
this.destroy = function() {
|
||||
on_data_disposable["dispose"]();
|
||||
term["dispose"]();
|
||||
};
|
||||
}
|
||||
|
||||
SerialAdapterXtermJS.prototype.show = function()
|
||||
|
|
|
@ -33,7 +33,7 @@ BusConnector.prototype.register = function(name, fn, this_value)
|
|||
* Unregister one message with the given name and callback
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {function()} fn
|
||||
* @param {function(?)} fn
|
||||
*/
|
||||
BusConnector.prototype.unregister = function(name, fn)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue