Skip to content
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

Don't delete _i18n in beforeDestroy #880

Merged
merged 1 commit into from May 15, 2020
Merged

Don't delete _i18n in beforeDestroy #880

merged 1 commit into from May 15, 2020

Conversation

danimoh
Copy link
Contributor

@danimoh danimoh commented May 14, 2020

Avoid that attempts to call methods on _i18n after destroying a
component fail. This is for example relevant for long running
async methods that were called before the component got destroyed
but terminate after the destruction and then try to call an i18n
method.
Note that _18n doesn't need to be cleared manually. It gets
garbage collected when the destroyed component gets destroyed.

Fixes #879

Other than mentioned in the issue, no addition of a boolean flag was
necessary, as the beforeDestroy hook is not called more than once and
the cleanup is only necessary if _i18n exists. Therefore the check for
_i18n still suffices.

Avoid that attempts to call methods on _i18n after destroying a
component fail. This is for example relevant for long running
async methods that were called before the component got destroyed
but terminate after the destruction and then try to call an i18n
method.
Note that _18n doesn't need to be cleared manually. It gets
garbage collected when the destroyed component gets destroyed.

Fixes #879
Copy link
Owner

@kazupon kazupon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kazupon kazupon added the Type: Bug Bug or Bug fixes label May 15, 2020
@kazupon kazupon merged commit 0b19b79 into kazupon:v8.x May 15, 2020
@rchl
Copy link
Contributor

rchl commented May 15, 2020

Note that _18n doesn't need to be cleared manually. It gets
garbage collected when the destroyed component gets destroyed.

I hope you have verified that that's true because I could easily see i18n preventing component from being garbage collected.

danimoh added a commit to nimiq/hub that referenced this pull request May 15, 2020
Don't delete _i18n in beforeDestroy
(kazupon/vue-i18n#880):
Avoid that translations in long-running methods throw on
translations after destruction.

Allow component interpolation without root element
(kazupon/vue-i18n#878):
For fixed responsiveness of the mobile checkout cancel
button.
danimoh added a commit to nimiq/hub that referenced this pull request Jun 15, 2020
Don't delete _i18n in beforeDestroy
(kazupon/vue-i18n#880):
Avoid that translations in long-running methods throw on
translations after destruction.

Allow component interpolation without root element
(kazupon/vue-i18n#878):
For fixed responsiveness of the mobile checkout cancel
button.
danimoh added a commit to nimiq/hub that referenced this pull request Jun 17, 2020
Don't delete _i18n in beforeDestroy
(kazupon/vue-i18n#880):
Avoid that translations in long-running methods throw on
translations after destruction.

Allow component interpolation without root element
(kazupon/vue-i18n#878):
For fixed responsiveness of the mobile checkout cancel
button.
mraveux pushed a commit to nimiq/hub that referenced this pull request Jun 22, 2020
Don't delete _i18n in beforeDestroy
(kazupon/vue-i18n#880):
Avoid that translations in long-running methods throw on
translations after destruction.

Allow component interpolation without root element
(kazupon/vue-i18n#878):
For fixed responsiveness of the mobile checkout cancel
button.
danimoh added a commit to nimiq/hub that referenced this pull request Jul 2, 2020
Don't delete _i18n in beforeDestroy
(kazupon/vue-i18n#880):
Avoid that translations in long-running methods throw on
translations after destruction.

Allow component interpolation without root element
(kazupon/vue-i18n#878):
For fixed responsiveness of the mobile checkout cancel
button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged Type: Bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't cleanup _i18n in beforeDestroy
3 participants