Xamarin Forms Non-Freeing Navigation

I'm new to Xamarin.Forms using Xamarin.forms (version 2.0.0), and I'm stuck in a problem where my application gets Crash over and over again due to a memory leak. I suspect that this is due to the fact that when moving a page from the navigation stack, the memory for the view is not freed. Even I am a user of the Dispose () method for freeing unused links. But there is still this error. Heap space grows every time I review. Below is an example of the code how I execute the navigation stack (push / pop).

    Navigation.PushModalAsync (new NewPage ());
    Navigation.PopAsync ());

Is there any solution for this problem or is there still a bug in Xamarin.Forms?

+4
source share
1 answer

PopAsync is not paired for PushModalAsync

You should use a pair of PushModalAsync () with PopModalAsync ().

And PushAsync () with PopAsync ().

Then you will not detect a memory leak.

+3
source

Source: https://habr.com/ru/post/1618564/


All Articles