|
-
April 19th, 1999, 07:00 AM
#1
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
-
April 19th, 1999, 07:12 AM
#2
Re: Memory leaks
Delete them when your parentwindow is closed.
-
April 19th, 1999, 07:19 AM
#3
Re: Memory leaks
Delete all zone allocated with new in LVN_DELETEALLITEMS
Sincerely, Mihai
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|