remove listener on dispose

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-07-01 15:42:07 +05:30
parent 93e77a3fcd
commit b8c01272f4

View file

@ -191,6 +191,7 @@ export class Platform {
} }
} }
this._container.addEventListener("error", handleAvatarError, true); this._container.addEventListener("error", handleAvatarError, true);
this._disposables.track(() => this._container.removeEventListener("error", handleAvatarError, true));
window.__hydrogenViewModel = vm; window.__hydrogenViewModel = vm;
const view = new RootView(vm); const view = new RootView(vm);
this._container.appendChild(view.mount()); this._container.appendChild(view.mount());