You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If my understanding is correct, the initial set of nav stacks should look as follows:
Component
Nav Controller Type
Nav Stack
AppComponent
Nav
[ HomePage ]
HomePage
Nav
[ TabsView ]
TabsView
Tabs
[ Tab1Component ], [ Tab2Component ] -> One nav stack per tab
You can see the stream observer in the Tab1Component printing console logs once a second.
When you click on the Change the root page button in the 1st tab,
the .setRoot(AltHomePage) is called on the application's root nav controller.
At this point I'd expect the only nav stack to be like this:
Component
Nav Controller Type
Nav Stack
AppComponent
Nav
[ AltHomePage ]
I would also expect the nested nav stacks to be destroyed along with the pages they contain.
However, we can observe that:
The subscription made in the 1st tab remain active and reacts on new stream data
The ionViewWillUnload() methods of the components in the nested nav controllers' stacks are not called
The ngOnDestroy() hooks are called
So it seems like the components are actually destroyed from Angular's point of view, but not from Ionic's one.
Moreover, it seems like Ionic continues to keep track of the nested nav stacks (that should be removed at this point)
thus preventing the page instances from being released from memory.
This issue leads to memory leaks.
My impression is that some cleanup methods are not called in the Ionic's navigation system internals.
Anyways, I think there should be a way to release all the resources (nav controllers and relative pages) related to a nav stack.
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.1.13
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: OS X El Capitan
Node Version: v6.5.0
Xcode version: Xcode 8.1 Build version 8B62
The text was updated successfully, but these errors were encountered:
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Ionic version: (check one with "x")
[ ] 1.x
[x] 2.x
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
When using nested navigation stacks, the children nav stacks are not destroyed when their root does.
Expected behavior:
All the children nav stacks along with the pages they contain should be destroyed when their root nav stack is destroyed.
Steps to reproduce:
Plunkr link: http://plnkr.co/edit/365N234EjkVepp1GQbhJ?p=preview
If my understanding is correct, the initial set of nav stacks should look as follows:
You can see the stream observer in the
Tab1Component
printing console logs once a second.When you click on the
Change the root page
button in the 1st tab,the
.setRoot(AltHomePage)
is called on the application's root nav controller.At this point I'd expect the only nav stack to be like this:
I would also expect the nested nav stacks to be destroyed along with the pages they contain.
However, we can observe that:
ionViewWillUnload()
methods of the components in the nested nav controllers' stacks are not calledngOnDestroy()
hooks are calledSo it seems like the components are actually destroyed from Angular's point of view, but not from Ionic's one.
Moreover, it seems like Ionic continues to keep track of the nested nav stacks (that should be removed at this point)
thus preventing the page instances from being released from memory.
This issue leads to memory leaks.
My impression is that some cleanup methods are not called in the Ionic's navigation system internals.
Anyways, I think there should be a way to release all the resources (nav controllers and relative pages) related to a nav stack.
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):The text was updated successfully, but these errors were encountered: