]> git.saurik.com Git - wxWidgets.git/commitdiff
don't free user data before sending wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, this prevent...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 23 Sep 2004 10:07:25 +0000 (10:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 23 Sep 2004 10:07:25 +0000 (10:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listctrl.cpp

index 7c420ac16adf7c2782c42e9ca15d64f8ab3deee9..9d2fc92173833fe96d31e4d8ffa633eb4d9ef33a 100644 (file)
@@ -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: