X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/22a70443dbfca84686b01c42c98e7cc61a21f307..904ccf52370e021b55b8a4c1afc5f62bc904da20:/src/mac/combobox.cpp diff --git a/src/mac/combobox.cpp b/src/mac/combobox.cpp index db47c86aaa..e67e1d9601 100644 --- a/src/mac/combobox.cpp +++ b/src/mac/combobox.cpp @@ -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; + } }