[msw 2.8.7] Problem saving application settings when system is shut
down
Eric Jensen
ml at j-dev.de
Tue Apr 8 10:23:29 PDT 2008
Hi all,
i know there is a previous thread with this topic, but it didn't
really solve the problem.
I added some additional event handlers and logfile output to the
minimal sample to describe the problem.
When the application is started and quit using the menu entry or close
button of the main frame, i get this log:
04/08/08 17:33:59: MyFrame::OnClose
04/08/08 17:33:59: MyFrame::~MyFrame()
04/08/08 17:33:59: MyApp::OnExit
OnClose handler called, then frame dtor, then wxApp::Exit().
That's what i expected.
However, when the system is shut down, i get this:
04/08/08 17:34:45: MyApp::OnAppQueryEndSession
04/08/08 17:34:45: MyFrame::OnClose
04/08/08 17:34:45: MyApp::OnAppEndSession
04/08/08 17:34:45: MyFrame::OnClose
I receive the EVT_END_SESSION events and the OnClose handler gets
called, but neither the frame dtor nor wxApp::Exit().
Event if i explicitly call frame->Destroy() or wxApp()::ExitMainLoop()
in the EVT_END_SESSION event handler this does not change.
Is this the "normal" expected behavior?
Problem is that my application settings are saved in the dtors of
several different classes and calling them all explictly from the
EVT_END_SESSION event will be quite some work (and probably lead to
pretty ugly code)
Thanks for any input.
Eric.
More information about the wx-users
mailing list