MOBILE-3833 core: Add missing managers destroy

main
Noel De Martin 2022-04-13 13:56:11 +02:00
parent 2c8850b669
commit e79172518e
3 changed files with 11 additions and 2 deletions

View File

@ -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.
*

View File

@ -640,6 +640,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea
CoreSync.unblockOperation(AddonModForumProvider.COMPONENT, this.syncId);
}
this.isDestroyed = true;
this.discussions?.destroy();
}
}

View File

@ -126,6 +126,7 @@ export class CoreSitePreferencesPage implements AfterViewInit, OnDestroy {
ngOnDestroy(): void {
this.isDestroyed = true;
this.sitesObserver?.off();
this.handlers.destroy();
}
}