Fixed bug [ 743664 ] wxListCtrl asserts when deleting its m_textCtrl

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2003-06-01 20:12:30 +00:00
parent 65b683fd1b
commit c546974fbf

View File

@ -1841,7 +1841,19 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
wxConvertFromMSWListItem(NULL, event.m_item, item);
if ( ((LV_ITEM)item).pszText == NULL ||
((LV_ITEM)item).iItem == -1 )
{
// don't keep a stale wxTextCtrl around
if ( m_textCtrl )
{
// EDIT control will be deleted by the list control itself so
// prevent us from deleting it as well
m_textCtrl->UnsubclassWin();
m_textCtrl->SetHWND(0);
delete m_textCtrl;
m_textCtrl = NULL;
}
return FALSE;
}
event.m_itemIndex = event.m_item.m_itemId;
}
@ -1853,7 +1865,19 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
wxConvertFromMSWListItem(NULL, event.m_item, item);
if ( ((LV_ITEM)item).pszText == NULL ||
((LV_ITEM)item).iItem == -1 )
{
// don't keep a stale wxTextCtrl around
if ( m_textCtrl )
{
// EDIT control will be deleted by the list control itself so
// prevent us from deleting it as well
m_textCtrl->UnsubclassWin();
m_textCtrl->SetHWND(0);
delete m_textCtrl;
m_textCtrl = NULL;
}
return FALSE;
}
event.m_itemIndex = event.m_item.m_itemId;
}