fix(ampy): 添加 dispose 方法 null 检查防止重复调用报错

This commit is contained in:
yczpf2019
2026-01-24 20:28:38 +08:00
parent c232332d69
commit 0c6199d8e4

View File

@@ -417,12 +417,16 @@ class AmpyExt extends Ampy {
async dispose() {
this.#active_ = false;
if (this.#device_) {
await this.#device_.dispose();
this.#device_ = null;
}
if (this.#events_) {
this.#events_.reset();
this.#events_ = null;
}
}
}
Web.Ampy = AmpyExt;