destructor must zero out fields that are WXGC_IGNOREd

svn: r4975
This commit is contained in:
Matthew Flatt 2006-11-29 01:08:36 +00:00
parent ee88a04972
commit c6d593419b
6 changed files with 23 additions and 7 deletions

View File

@ -24,6 +24,7 @@ wxMacDC::wxMacDC(CGrafPtr port)
//-----------------------------------------------------------------------------
wxMacDC::~wxMacDC(void) // destructor
{
cCurrentUser = NULL;
}
//-----------------------------------------------------------------------------

View File

@ -194,11 +194,13 @@ wxMenu::~wxMenu(void)
wxNode* node;
wxMenuItem* item;
if (menu_bar) // may have to remove menu from the current mac menu bar
{
menu_bar->Delete(this);
} else if (window_parent)
((wxMenu *)window_parent)->Delete(this, 0, -1);
if (menu_bar) { // may have to remove menu from the current mac menu bar
menu_bar->Delete(this);
menu_bar = NULL;
} else if (window_parent) {
((wxMenu *)window_parent)->Delete(this, 0, -1);
window_parent = NULL;
}
::DisposeMenu(cMacMenu); // does not dispose of submenus

View File

@ -115,11 +115,15 @@ wxPrintData::wxPrintData(void)
wxPrintData::~wxPrintData(void)
{
if (cPrintSettings)
if (cPrintSettings) {
PMRelease(cPrintSettings);
cPrintSettings = NULL;
}
if (cPageFormat)
if (cPageFormat) {
PMRelease(cPageFormat);
cPageFormat = NULL;
}
if (cPrintSession) {
PMRelease(cPrintSession);

View File

@ -363,6 +363,11 @@ wxWindow::~wxWindow(void) // Destructor
DisposeControl(cPaintControl);
cPaintControl = NULL;
}
/* Must zero out fieldsd that are WXGC_IGNOREd: */
cParentArea = NULL;
cMacDC = NULL;
window_parent = NULL;
}
//=============================================================================

View File

@ -153,6 +153,8 @@ wxbMenu::wxbMenu (char *Title, wxFunction WXUNUSED(func))
// The wxWindow destructor will take care of deleting the submenus.
wxbMenu::~wxbMenu (void)
{
menu_bar= NULL;
top_level_menu = NULL;
}
wxMenuItem *wxbMenu::FindItemForId (long itemId, wxMenu ** itemMenu, int * pos)
@ -252,6 +254,7 @@ wxbMenuBar::wxbMenuBar (int N, wxMenu * Menus[], char *Titles[])
wxbMenuBar::~wxbMenuBar (void)
{
menu_bar_frame = NULL;
}
void wxbMenuBar::Append (wxMenu * menu, char *title)

View File

@ -466,6 +466,7 @@ wxCombo::wxCombo(wxWindow *for_canvas,
wxCombo::~wxCombo(void)
{
forCanvas = NULL;
}
Bool wxCombo::PreOnEvent(wxWindow *win, wxMouseEvent *e)