fixing memory leaks on three levels (bug report 1905138)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2008-05-04 13:49:42 +00:00
parent 175fea401a
commit 8f84d5c036

View File

@@ -777,6 +777,8 @@ wxListCtrl::~wxListCtrl()
delete m_imageListState;
delete m_renameTimer;
WX_CLEAR_LIST(wxColumnList, m_colsInfo);
}
/*static*/
@@ -2428,6 +2430,7 @@ void wxListCtrl::SetFocus()
wxMacListCtrlItem::~wxMacListCtrlItem()
{
WX_CLEAR_HASH_MAP( wxListItemList, m_rowItems );
}
void wxMacListCtrlItem::Notification(wxMacDataItemBrowserControl *owner ,
@@ -3009,16 +3012,25 @@ void wxMacDataBrowserListCtrlControl::ItemNotification(DataBrowserItemID itemID,
DataBrowserItemNotification message,
DataBrowserItemDataRef itemData )
{
// we want to depend on as little as possible to make sure tear-down of controls is safe
if ( message == kDataBrowserItemRemoved)
wxMacListCtrlItem *item = NULL;
if ( !m_isVirtual )
{
// make sure MacDelete does the proper teardown.
item = (wxMacListCtrlItem *) itemID;
}
// we want to depend on as little as possible to make sure tear-down of controls is safe
if ( message == kDataBrowserItemRemoved )
{
if ( item )
item->Notification(this, message, itemData);
return;
}
else if ( message == kDataBrowserItemAdded )
{
// we don't issue events on adding, the item is not really stored in the list yet, so we
// avoid asserts by getting out now
if ( item )
item->Notification(this, message, itemData);
return ;
}