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:
@@ -1841,7 +1841,19 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
wxConvertFromMSWListItem(NULL, event.m_item, item);
|
wxConvertFromMSWListItem(NULL, event.m_item, item);
|
||||||
if ( ((LV_ITEM)item).pszText == NULL ||
|
if ( ((LV_ITEM)item).pszText == NULL ||
|
||||||
((LV_ITEM)item).iItem == -1 )
|
((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;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
event.m_itemIndex = event.m_item.m_itemId;
|
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);
|
wxConvertFromMSWListItem(NULL, event.m_item, item);
|
||||||
if ( ((LV_ITEM)item).pszText == NULL ||
|
if ( ((LV_ITEM)item).pszText == NULL ||
|
||||||
((LV_ITEM)item).iItem == -1 )
|
((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;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
event.m_itemIndex = event.m_item.m_itemId;
|
event.m_itemIndex = event.m_item.m_itemId;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user