locked
How to safe exit the Windows Store app

    Question

  • I am create a project use template 'DirectX and XAML App (Windows)'.

    I set a break point at 'DirectXPage::~DirectXPage()',

    I found the program never go there.

    I try to use 'Alt+F4' or 'Suspend and shutdown' to close the app,

    but the problem also.

    So, I think the method I am use to close the app is same as KillProcess.

    I want to know,

    is there and method to safe close the app and let the program run to 'DirectXPage::~DirectXPage()'?

    Friday, December 12, 2014 9:19 AM

Answers

  • Hello,

    Far as I know, the destructor method was called by system when the object was not used. It uses reference counting and deletes objects when the reference count falls to 0. The program won’t go to interruption when debugging. The system manage the app life cycle and there is no available method of “safe close the app”. When you leaves the app, the system will suspend it and try to keep it in memory if there is enough resources. The system terminates the app when it thinks it is necessary. You can see more information from http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh464925.aspx. Please post more information about your scenario if you have any concerns.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.



    Monday, December 15, 2014 2:24 AM
    Moderator