From: Vadim Zeitlin Date: Fri, 30 Jul 2004 23:05:53 +0000 (+0000) Subject: fixed quitting the sample; fixed memory leak of CDummyWindow X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/cc3bb83d947be6bd6b70fa1c5a9e4a71819a485f?ds=inline fixed quitting the sample; fixed memory leak of CDummyWindow git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28551 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/mfc/mfctest.cpp b/samples/mfc/mfctest.cpp index 552aa76500..42aeae4726 100644 --- a/samples/mfc/mfctest.cpp +++ b/samples/mfc/mfctest.cpp @@ -194,6 +194,10 @@ BOOL CTheApp::InitInstance() int CTheApp::ExitInstance() { +#if !START_WITH_MFC_WINDOW + delete m_pMainWnd; +#endif + if ( wxTheApp ) wxTheApp->OnExit(); wxEntryCleanup(); @@ -332,6 +336,8 @@ MyChild::MyChild(wxFrame *frame, const wxString& title, const wxPoint& pos, cons MyChild::~MyChild() { + if ( IsLastBeforeExit() ) + PostQuitMessage(0); } void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event)) @@ -354,7 +360,7 @@ void MyChild::OnActivate(wxActivateEvent& event) // Dummy MFC window for specifying a valid main window to MFC, using // a wxWidgets HWND. -CDummyWindow::CDummyWindow(HWND hWnd):CWnd() +CDummyWindow::CDummyWindow(HWND hWnd) { Attach(hWnd); }