From 238e01679bd15eafa5c6a9d988f8b68905d76177 Mon Sep 17 00:00:00 2001 From: Henry Majoros Date: Fri, 30 Jul 2021 09:52:19 -0400 Subject: [PATCH] [BUGFIX LTS] fix memory leak in RouterService --- packages/@ember/-internals/routing/lib/services/router.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/@ember/-internals/routing/lib/services/router.ts b/packages/@ember/-internals/routing/lib/services/router.ts index 3c8d4b8e92d..9c07ccdc612 100644 --- a/packages/@ember/-internals/routing/lib/services/router.ts +++ b/packages/@ember/-internals/routing/lib/services/router.ts @@ -62,6 +62,12 @@ export default class RouterService extends Service { return (this[ROUTER] = router); } + willDestroy() { + super.willDestroy(...arguments); + + this[ROUTER] = null; + } + /** Transition the application into another route. The route may be either a single route or route path: