diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index e47b10a13d..64e1e60785 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -2429,13 +2429,13 @@ static void wxDeleteInternalData(wxListCtrl* ctl, long itemId) wxListItemInternalData *data = wxGetInternalData(ctl, itemId); if (data) { - delete data; LV_ITEM item; memset(&item, 0, sizeof(item)); item.iItem = itemId; item.mask = LVIF_PARAM; item.lParam = (LPARAM) 0; ListView_SetItem((HWND)ctl->GetHWND(), &item); + delete data; } }