
scalar deleting destructor?
Hello,
What could be the possible reasons for this error (scalar deleting
destructor) ?
I get it for 2 items out 16 in the tree when I execute "delete pItem" in
CModelView::OnDeleteItem (see below) but all the items are created the same
way so why some give that error and not others?
void CModelView::OnDeleteItem(NMHDR* pNMHDR, LRESULT* pResult)
{
NMTREEVIEW* pNMTreeView = (NMTREEVIEW*)pNMHDR;
CItem* pItem = (CItem*)(pNMTreeView->itemOld.lParam);
if (pItem)
delete pItem;
*pResult = 0;
Quote:
}
Here is the Call Stack:
CFolder::~CFolder() line 26
CFolder::`scalar deleting destructor'(unsigned int 1) + 100 bytes
CModelView::OnDeleteItem(tagNMHDR * 0x0012f188, long * 0x0012eee0) line 431
+ 126 bytes
CFolder is derived from CItem.
Right after the error BoundsChecker detects a memory leak of 32 bytes and
Location error points to the member "virtual UINT GetDefaultMenuItem() {
return 0; }". I guess the memory leak is "normal" because of the error above
but why on this member, what's wrong?
class CItem
{
public:
CItem(int nType, CItem* pParent, LPCTSTR pszItemPath, int nImage, int
nSelectedImage);
virtual ~CItem();
...
virtual UINT GetDefaultMenuItem() { return 0; }
...
Quote:
};
Any idea and explanations would be very much appreciated. Thanks.
--
No?l
http://www.*-*-*.com/