GC SpeakerAdapter

This commit is contained in:
Fabian 2022-07-29 00:18:38 +09:00
parent c4597d78aa
commit 6c04f68396
2 changed files with 7 additions and 0 deletions

View file

@ -58,6 +58,12 @@ function SpeakerAdapter(bus)
bus.send("speaker-has-initialized");
}
SpeakerAdapter.prototype.destroy = function()
{
this.audio_context && this.audio_context.close();
this.dac && this.dac.node_processor && this.dac.node_processor.port.close();
};
/**
* @constructor
* @param {!BusConnector} bus

View file

@ -715,6 +715,7 @@ V86Starter.prototype.destroy = function()
this.mouse_adapter && this.mouse_adapter.destroy();
this.screen_adapter && this.screen_adapter.destroy();
this.serial_adapter && this.serial_adapter.destroy();
this.speaker_adapter && this.speaker_adapter.destroy();
};
/**