Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
A popped UIViewController's finalizer will not get called before the next PushViewController() call on the same UINavigationController.
If however PopViewControllerAnimated() is overridden in this fashion
public override UIViewController PopViewControllerAnimated(bool animated)
a UIViewController's finalizer is called immediately after a 'pop'
First, I put it off as random GC behavior. But the behavior is consistent.
(1) overriden PopViewControllerAnimated: immediate finalization
(2) no overriden PopViewControllerAnimated: finalization after an arbitrary number of 'pop's and then one 'push'
Not sure if this is a bug. But the expected behavior in both cases would be that in (1) seeing how it seems to be possible to force it. It makes dealing with memory release that much easier and intuitive.
Please advise if I can rely on any of the behaviors
This is because managed code keeps a cache of the current view controllers, which is only updated when you push a new view controller (since no managed code is usually executed when a view controller is pushed, unless you override PopViewControllerAnimated - and then the cache is updated for pops too).
In any case this has already been filed as bug #1889.
*** This bug has been marked as a duplicate of bug 1889 ***