From 7a46263195573a6e310b6ca74bd0ced613a56597 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 25 Jan 2005 13:58:01 +0000 Subject: [PATCH] fixed memory leak with client data when using DeleteAllItems() (bug 1107215) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 0eeef36021..25c10a2929 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1232,7 +1232,7 @@ bool wxListCtrl::DeleteItem(long item) return false; } - m_count -= 1; + m_count--; wxASSERT_MSG( m_count == ListView_GetItemCount(GetHwnd()), wxT("m_count should match ListView_GetItemCount")); @@ -1264,7 +1264,6 @@ bool wxListCtrl::DeleteItem(long item) // Deletes all items bool wxListCtrl::DeleteAllItems() { - m_count = 0; return ListView_DeleteAllItems(GetHwnd()) != 0; } @@ -1819,7 +1818,8 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // ignored for efficiency. It is done here because the internal data is in the // process of being deleted so we don't want to try and access it below. if ( m_ignoreChangeMessages && - ( (nmLV->hdr.code == LVN_ITEMCHANGED) || (nmLV->hdr.code == LVN_ITEMCHANGING))) + ( (nmLV->hdr.code == LVN_ITEMCHANGED) || + (nmLV->hdr.code == LVN_ITEMCHANGING)) ) { return true; } -- 2.45.2