-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(router): prevent memory leaks by removing app references from $router.apps once app destroyed (Fixes #2639) #2640
Conversation
…ixes vuejs#2639) Prevent destroyed apps from causing memory leak in `$router.apps` array. Fixes vuejs#2639
Prevents history listeners from being set up multiple times
merge dev into patch
@posva I have added test suites, and handled situation where the main (initial) app is destroyed. |
Just wondering if there should be additional test(s) for a nested router (i.e. a second |
What do you mean by nested router? |
@posva I see in the e2e tests there are tests for nested routers (a router within a router): https://github.com/vuejs/vue-router/blob/dev/test/e2e/specs/nested-router.js https://github.com/vuejs/vue-router/tree/dev/examples/nested-router Although the multiple routers share the same Router class instance, so probably additional testing isn't necessary. |
Closing in favor of #2706 |
Prevent memory leaks by removing app(s) from
$router.apps
array once app has been destroyed.Fixes #2639