From f7df21aadf1e921b76e34cd7f78ba5db33301a13 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 23 Sep 2004 10:07:25 +0000 Subject: [PATCH] don't free user data before sending wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, this prevents user from doing cleanup in his OnDeleteAllItems() handler git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 7c420ac16a..9d2fc92173 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1260,7 +1260,6 @@ bool wxListCtrl::DeleteItem(long item) // Deletes all items bool wxListCtrl::DeleteAllItems() { - FreeAllInternalData(); return ListView_DeleteAllItems(GetHwnd()) != 0; } @@ -2170,6 +2169,10 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // notifications - this makes deleting all items from a list ctrl // much faster *result = TRUE; + + // also, we may free all user data now (couldn't do it before as + // the user should have access to it in OnDeleteAllItems() handler) + FreeAllInternalData(); return true; case LVN_ENDLABELEDITA: -- 2.45.2