fix(NativeScriptPlatformRef): Destroy lastModuleRef on exitEvent#1728
Merged
elena-p merged 14 commits intoNativeScript:masterfrom Apr 15, 2019
m-abs:fix/923-module-not-destroyed
Merged
fix(NativeScriptPlatformRef): Destroy lastModuleRef on exitEvent#1728elena-p merged 14 commits intoNativeScript:masterfrom m-abs:fix/923-module-not-destroyed
elena-p merged 14 commits intoNativeScript:masterfrom
m-abs:fix/923-module-not-destroyed
Conversation
Contributor
|
test |
vakrilov
previously approved these changes
Feb 14, 2019
Contributor
|
LGTM - triggered the CI. |
This was referenced Feb 17, 2019
Contributor
|
test |
…escript-angular into fix/923-module-not-destroyed
vakrilov
previously approved these changes
Feb 21, 2019
Contributor
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Contributor
Author
|
Hi @vakrilov, I just noticed a problem On Android 9.
This will have triggered an exit event and tried to destroy the angular application, but it is still running. You can see the problem here:
I print out the app events: JS: suspend # Leave the app to change the font size
JS: activityPaused
JS: activityStopped
JS: orientationChanged # Font size changed in while I'm in settings
JS: exit # Returned to the app
JS: activityDestroyed
JS: activityCreated
JS: activityStarted
JS: activityResumed
JS: resume
JS: displayed
JS: displayed |
If exit event was triggered twice we would try to destroy an already destroy module ref.
…escript-angular into fix/923-module-not-destroyed
Don't destroy the angular module on restart
Contributor
Author
|
I solved the problem. The I added a test for this case in the |
vakrilov
approved these changes
Apr 5, 2019
Contributor
|
test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests for the changes are included.Don't see howWhat is the current behavior?
The application module isn't destroyed when the application exitEvent is triggered.
This causes the previous instance of the nativescript-angular app to be running in a sleep state and
ngOnDestroy()on it's compoments, services etc. are not called as expected.What is the new behavior?
Adds an event listener for the
exitEventin theNativeScriptPlatformRefwhich destroys thelastModuleRefwhich triggersngOnDestroy()as expected.Fixes #923