fix(all): memory leaks

fixes #10459
fixes #10416
fixes #10286
This commit is contained in:
Manu Mtz.-Almeida
2017-02-23 20:55:30 +01:00
parent be0b6a8872
commit 8d9f374065
13 changed files with 25 additions and 21 deletions

View File

@ -62,7 +62,7 @@ export class PanGesture {
unlisten() {
if (this.isListening) {
this.gestute && this.gestute.release();
this.events.destroy();
this.events.unlistenAll();
this.isListening = false;
}
}
@ -71,7 +71,8 @@ export class PanGesture {
this.gestute && this.gestute.destroy();
this.gestute = null;
this.unlisten();
this.element = null;
this.events.destroy();
this.events = this.element = this.gestute = null;
}
pointerDown(ev: any): boolean {

View File

@ -43,10 +43,15 @@ export class UIEventManager {
}
}
destroy() {
unlistenAll() {
this.evts.forEach(unRegEvent => {
unRegEvent();
});
this.evts.length = 0;
}
destroy() {
this.unlistenAll();
this.evts = null;
}
}