Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v-once and "unmount callbacks", possible memory leak? #5154

@CamilleDrapier

Description

@CamilleDrapier

Version

3.2.26

Reproduction link

codesandbox.io

Steps to reproduce

  • click on the "toggle" button at least twice

What is expected?

Console statements saying that the "OtherCmponent" is unmounted/destroyed are shown along with the "mounted" statements.

What is actually happening?

Only the mount statements are shown


This was behaving differently in vue2, as the "destroy callbacks" were called, see: https://codesandbox.io/s/lingering-water-j7g43

This might also be related to this external issue: intlify/vue-i18n#844 (I think I can see evidence of something similar with vue-router) and generally, it might introduce memory leaks when using Components that were not specifically written to account for the beforeUnmount/unmounted not being called.

Please do let me know if this is not an issue but just a documentation miss (is it specified somewhere or should it be?), or if this is just my misunderstanding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions