Handle client data correctly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -327,8 +327,7 @@ void wxComboBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
|||||||
wxList::compatibility_iterator node = m_clientObjectList.Item( n );
|
wxList::compatibility_iterator node = m_clientObjectList.Item( n );
|
||||||
if (!node) return;
|
if (!node) return;
|
||||||
|
|
||||||
wxClientData *cd = (wxClientData*) node->GetData();
|
// wxItemContainer already deletes data for us
|
||||||
if (cd) delete cd;
|
|
||||||
|
|
||||||
node->SetData( (wxObject*) clientData );
|
node->SetData( (wxObject*) clientData );
|
||||||
}
|
}
|
||||||
|
@@ -327,8 +327,7 @@ void wxComboBox::DoSetItemClientObject( int n, wxClientData* clientData )
|
|||||||
wxList::compatibility_iterator node = m_clientObjectList.Item( n );
|
wxList::compatibility_iterator node = m_clientObjectList.Item( n );
|
||||||
if (!node) return;
|
if (!node) return;
|
||||||
|
|
||||||
wxClientData *cd = (wxClientData*) node->GetData();
|
// wxItemContainer already deletes data for us
|
||||||
if (cd) delete cd;
|
|
||||||
|
|
||||||
node->SetData( (wxObject*) clientData );
|
node->SetData( (wxObject*) clientData );
|
||||||
}
|
}
|
||||||
|
@@ -162,7 +162,10 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
wxComboBox::~wxComboBox()
|
wxComboBox::~wxComboBox()
|
||||||
{
|
{
|
||||||
// delete the controls now, don't leave them alive even though they would
|
// delete client objects
|
||||||
|
FreeData();
|
||||||
|
|
||||||
|
// 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
|
// still be eventually deleted by our parent - but it will be too late, the
|
||||||
// user code expects them to be gone now
|
// user code expects them to be gone now
|
||||||
if (m_text != NULL) {
|
if (m_text != NULL) {
|
||||||
|
@@ -162,7 +162,10 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
wxComboBox::~wxComboBox()
|
wxComboBox::~wxComboBox()
|
||||||
{
|
{
|
||||||
// delete the controls now, don't leave them alive even though they would
|
// delete client objects
|
||||||
|
FreeData();
|
||||||
|
|
||||||
|
// 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
|
// still be eventually deleted by our parent - but it will be too late, the
|
||||||
// user code expects them to be gone now
|
// user code expects them to be gone now
|
||||||
if (m_text != NULL) {
|
if (m_text != NULL) {
|
||||||
|
Reference in New Issue
Block a user