From e79172518ea0920f80571448eefb50ba5564181f Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 13 Apr 2022 13:56:11 +0200 Subject: [PATCH] MOBILE-3833 core: Add missing managers destroy --- .../badges/pages/issued-badge/issued-badge.page.ts | 11 +++++++++-- .../forum/pages/new-discussion/new-discussion.page.ts | 1 + src/core/features/settings/pages/site/site.ts | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/addons/badges/pages/issued-badge/issued-badge.page.ts b/src/addons/badges/pages/issued-badge/issued-badge.page.ts index 1fc7a21be..675957abd 100644 --- a/src/addons/badges/pages/issued-badge/issued-badge.page.ts +++ b/src/addons/badges/pages/issued-badge/issued-badge.page.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, OnInit } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { IonRefresher } from '@ionic/angular'; import { CoreTimeUtils } from '@services/utils/time'; import { CoreDomUtils } from '@services/utils/dom'; @@ -34,7 +34,7 @@ import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/ selector: 'page-addon-badges-issued-badge', templateUrl: 'issued-badge.html', }) -export class AddonBadgesIssuedBadgePage implements OnInit { +export class AddonBadgesIssuedBadgePage implements OnInit, OnDestroy { protected badgeHash = ''; protected userId!: number; @@ -71,6 +71,13 @@ export class AddonBadgesIssuedBadgePage implements OnInit { this.badges.start(); } + /** + * @inheritdoc + */ + ngOnDestroy(): void { + this.badges.destroy(); + } + /** * Fetch the issued badge required for the view. * diff --git a/src/addons/mod/forum/pages/new-discussion/new-discussion.page.ts b/src/addons/mod/forum/pages/new-discussion/new-discussion.page.ts index 699eaf7ec..bd1592ce4 100644 --- a/src/addons/mod/forum/pages/new-discussion/new-discussion.page.ts +++ b/src/addons/mod/forum/pages/new-discussion/new-discussion.page.ts @@ -640,6 +640,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea CoreSync.unblockOperation(AddonModForumProvider.COMPONENT, this.syncId); } this.isDestroyed = true; + this.discussions?.destroy(); } } diff --git a/src/core/features/settings/pages/site/site.ts b/src/core/features/settings/pages/site/site.ts index c2659848f..57826c5ea 100644 --- a/src/core/features/settings/pages/site/site.ts +++ b/src/core/features/settings/pages/site/site.ts @@ -126,6 +126,7 @@ export class CoreSitePreferencesPage implements AfterViewInit, OnDestroy { ngOnDestroy(): void { this.isDestroyed = true; this.sitesObserver?.off(); + this.handlers.destroy(); } }