improved memory liberation (explicitly set to NULL after delete)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot
2002-06-23 17:22:54 +00:00
parent d208e6412a
commit f5bb225133
20 changed files with 140 additions and 80 deletions

View File

@@ -104,16 +104,19 @@ BEGIN_EVENT_TABLE(wxComboBoxChoice, wxChoice)
EVT_CHOICE(-1, wxComboBoxChoice::OnChoice)
END_EVENT_TABLE()
wxComboBox::~wxComboBox()
{
// delete the controls now, don't leave them alive even though they woudl
// delete the controls now, don't leave them alive even though they would
// still be eventually deleted by our parent - but it will be too late, the
// user code expects them to be gone now
delete m_text;
delete m_choice;
if (m_text != NULL) {
delete m_text;
m_text = NULL;
}
if (m_choice != NULL) {
delete m_choice;
m_choice = NULL;
}
}