Skip to content

Fixed recursive wrapping of data function that leads to memory leak (asyncData plugin).#66

Open
mr-luke wants to merge 1 commit intouniversal-vue:devfrom
mr-luke:fix/async-data-mem-leak
Open

Fixed recursive wrapping of data function that leads to memory leak (asyncData plugin).#66
mr-luke wants to merge 1 commit intouniversal-vue:devfrom
mr-luke:fix/async-data-mem-leak

Conversation

@mr-luke
Copy link
Copy Markdown

@mr-luke mr-luke commented May 13, 2022

What kind of change does this PR introduce?

Fixed memory leak of asyncData plugin.

What is the current behavior?

There's a recursive wrapping of data function which adds a new level each time SSR renders same component. This leads up to stuck references of asyncData variable that cannot be collected by GC.

What is the new behavior?

Under first attempt the original data function is cloned to internal options' property to ensure that each wrapping works on correct function.

Checklist:

  • Documentation
  • Tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant