Skip to content

docs: memory leak due to vue-router maintaining references to destroyed apps #2769

@tmorehouse

Description

@tmorehouse

It appears that Vue-Router maintains an array of all apps registered to use the $router in the this.$router.apps array.

When an app is destroyed, Vue router does not remove the reference to the destroyed app from this array.

Every time a user types into a live example (or the playgroud), teh rendered example app is destroyed and recreated (i.e. live). Or if a user switches pages in the docs, the live examples get destroyed from the previous page. In both these cases, the destroyed app references are not being removed from the $router.apps array, causing a memory leak.

Upstream issue created at vuejs/vue-router#2639 and PR at vuejs/vue-router#2640

We could temporarily fix the issue by manually removing the app reference from $router.apps array once the app is destroyed by v-play (for live docs examples) and in the playground, but this should be the responsibility of Vue-Router to clean up after itself.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions