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

@@ -183,6 +183,7 @@ export class ActionSheetCmp {
ngOnDestroy() {
assert(this.gestureBlocker.blocked === false, 'gesture blocker must be already unblocked');
this.d = null;
this.gestureBlocker.destroy();
}
}

View File

@@ -516,7 +516,7 @@ export class Menu {
this.isOpen = isOpen;
this._isAnimating = false;
this._events.destroy();
this._events.unlistenAll();
if (isOpen) {
// Disable swipe to go back gesture
this._gestureBlocker.block();

View File

@@ -503,6 +503,7 @@ export class Refresher {
* @private
*/
ngOnDestroy() {
this._events.destroy();
this._gesture.destroy();
this._setListeners(false);
}

View File

@@ -411,6 +411,7 @@ export class Tabs extends Ion implements AfterViewInit {
if (opts.updateUrl !== false) {
this._linker.navChange(DIRECTION_SWITCH);
}
assert(this.getSelected() === selectedTab, 'selected tab does not match');
this._fireChangeEvent(selectedTab);
});
} else {
@@ -419,8 +420,6 @@ export class Tabs extends Ion implements AfterViewInit {
}
_fireChangeEvent(selectedTab: Tab) {
assert(this.getSelected() === selectedTab, 'selected tab does not match');
selectedTab.ionSelect.emit(selectedTab);
this.ionChange.emit(selectedTab);
}