[UWP][C++/CX] Page destructor not called after close app why?

isrepeat 1 Reputation point
2021-04-09T08:51:46.543+00:00

I have following code:

public ref class MainPage sealed
{
public:
    MainPage()
    {
        int a = 1;
    }
private:
    ~MainPage()
    {
        int b = 2;
    }
};

Why the destructor MainPage is not called when I close app?

However when change MainPage on other Page due to Navigate destructor MainPage is called.
It's normal for uwp not calling destructor current page when we closing app?
How i can foreced call destructor if i want?

Universal Windows Platform (UWP)
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,527 questions
{count} votes