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

PRO doesn't clear all outlets correctly #2303

Open
karsie opened this issue Nov 26, 2020 · 0 comments · May be fixed by #2304
Open

PRO doesn't clear all outlets correctly #2303

karsie opened this issue Nov 26, 2020 · 0 comments · May be fixed by #2304

Comments

@karsie
Copy link

karsie commented Nov 26, 2020

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.8.0
  • Cross-platform modules:
  • Android Runtime:
  • iOS Runtime:
  • Plugin(s):
  • NativeScript-Angular: 8.21.0
  • Angular: 8.2.14

Describe the bug
We use a PRO / nested PRO with tabview setup and when we navigate with clearHistory in one of the tabs, of all pages on the backStack in that PRO the ngOnDestroy is not called until the app is shut down. ngOnDestroy is called successfully on backbutton. After investigation we found out that not every navigation (a.k.a routeReuseStrategy.store) in a tab outlet is stored under the same outletKey, resulting in multiple outlet keys, but loadComponentInPage only clears the first outletKey.

To Reproduce
Setup an angular app with a tabview, add a few navigations in a single tab with the last one a clearHistory: true, add logging to ngOnDestroy of every page. Check to see that not all ngOnDestroys have been called.

Expected behavior
Every ngOnDestroy of every destroyed page should be called.

Sample project

Additional context
We often subscribe/unsubscribe in ngOnInit/ngOnDestroy in pages, so this leads to memory leaks and observable leaks for us.

@karsie karsie linked a pull request Nov 26, 2020 that will close this issue
5 tasks
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 a pull request may close this issue.

1 participant