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
This commit is contained in:
@@ -194,6 +194,10 @@ BOOL CTheApp::InitInstance()
|
|||||||
|
|
||||||
int CTheApp::ExitInstance()
|
int CTheApp::ExitInstance()
|
||||||
{
|
{
|
||||||
|
#if !START_WITH_MFC_WINDOW
|
||||||
|
delete m_pMainWnd;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( wxTheApp )
|
if ( wxTheApp )
|
||||||
wxTheApp->OnExit();
|
wxTheApp->OnExit();
|
||||||
wxEntryCleanup();
|
wxEntryCleanup();
|
||||||
@@ -332,6 +336,8 @@ MyChild::MyChild(wxFrame *frame, const wxString& title, const wxPoint& pos, cons
|
|||||||
|
|
||||||
MyChild::~MyChild()
|
MyChild::~MyChild()
|
||||||
{
|
{
|
||||||
|
if ( IsLastBeforeExit() )
|
||||||
|
PostQuitMessage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
|
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
|
// Dummy MFC window for specifying a valid main window to MFC, using
|
||||||
// a wxWidgets HWND.
|
// a wxWidgets HWND.
|
||||||
CDummyWindow::CDummyWindow(HWND hWnd):CWnd()
|
CDummyWindow::CDummyWindow(HWND hWnd)
|
||||||
{
|
{
|
||||||
Attach(hWnd);
|
Attach(hWnd);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user