fix an mdi crash on exit
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29346 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#include "wx/mdi.h"
|
#include "wx/mdi.h"
|
||||||
|
#include "wx/notebook.h"
|
||||||
|
|
||||||
#if wxUSE_MDI
|
#if wxUSE_MDI
|
||||||
|
|
||||||
@@ -82,8 +83,11 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
|||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
|
wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
|
||||||
|
// CE: we come here in the destructor with a null child_frame - I think because
|
||||||
wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") );
|
// gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page", (see below)
|
||||||
|
// isn't deleted early enough
|
||||||
|
if (!child_frame)
|
||||||
|
return ;
|
||||||
|
|
||||||
if (child_frame->m_page == page)
|
if (child_frame->m_page == page)
|
||||||
{
|
{
|
||||||
@@ -329,7 +333,7 @@ wxMDIChildFrame::~wxMDIChildFrame()
|
|||||||
{
|
{
|
||||||
if (m_menuBar)
|
if (m_menuBar)
|
||||||
delete m_menuBar;
|
delete m_menuBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
|
bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
|
||||||
wxWindowID id, const wxString& title,
|
wxWindowID id, const wxString& title,
|
||||||
@@ -484,6 +488,7 @@ wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style )
|
|||||||
|
|
||||||
wxMDIClientWindow::~wxMDIClientWindow()
|
wxMDIClientWindow::~wxMDIClientWindow()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#include "wx/mdi.h"
|
#include "wx/mdi.h"
|
||||||
|
#include "wx/notebook.h"
|
||||||
|
|
||||||
#if wxUSE_MDI
|
#if wxUSE_MDI
|
||||||
|
|
||||||
@@ -82,8 +83,11 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
|||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
|
wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );
|
||||||
|
// CE: we come here in the destructor with a null child_frame - I think because
|
||||||
wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") );
|
// gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page", (see below)
|
||||||
|
// isn't deleted early enough
|
||||||
|
if (!child_frame)
|
||||||
|
return ;
|
||||||
|
|
||||||
if (child_frame->m_page == page)
|
if (child_frame->m_page == page)
|
||||||
{
|
{
|
||||||
@@ -329,7 +333,7 @@ wxMDIChildFrame::~wxMDIChildFrame()
|
|||||||
{
|
{
|
||||||
if (m_menuBar)
|
if (m_menuBar)
|
||||||
delete m_menuBar;
|
delete m_menuBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
|
bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
|
||||||
wxWindowID id, const wxString& title,
|
wxWindowID id, const wxString& title,
|
||||||
@@ -484,6 +488,7 @@ wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style )
|
|||||||
|
|
||||||
wxMDIClientWindow::~wxMDIClientWindow()
|
wxMDIClientWindow::~wxMDIClientWindow()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
|
||||||
|
Reference in New Issue
Block a user