-
Memory leaks
Hi,
I'm sorting a ListCtrl. I'm setting Item Data for the CALLBACK compare function like this:
CItemInfo *pItemInfo = new CItemInfo();
pItemInfo->SetLabel(strLabel);
m_ctlList.SetItemData(index, (LPARAM)pItemInfo);
This is working fine, but the debugger detects memory leaks when quitting the app. I think the pointers should be deleted, but I don't know how. When they are in scope, I can't delete them because the CALLBACK needs them. Is it possible to delete them when exiting? Or is there something else I should do?
Any help is appreciated,
Stijn
-
Re: Memory leaks
Delete them when your parentwindow is closed.
-
Re: Memory leaks
Delete all zone allocated with new in LVN_DELETEALLITEMS
Sincerely, Mihai