In iPadOS18 UITabBarController not releasing viewControllers after deinit with sidebar enabled.
On checking the memory Graph Debugger we could see that the viewControllers are hold by UITab which in turn hold by UITabSidebarItem. We don't have control over the UITabSidebarItem and unable to remove the reference.
The issue not happens when tabbarController mode is set to 'tabBar' instead of 'sidebar'.
We have event tried to set empty tabs before dismiss the view but still the original tabs are not removing in memory and holding the viewcontollers as well.
Anyone assist on this issue. Sharing the sample code here