Hi,
The scenario is as follows:
I have the following code snippet in OnCreate() of my class:
CMFCTabCtrl m_TabsWnd;
// Create Tab
// Create tabs window:
if (!m_TabsWnd.Create(CMFCTabCtrl::STYLE_FLAT, rect_dummy, this, 5))
{
TRACE0("Failed to create output tab window\n");
return -1; // fail to create
}
CDockablePane mp_Tab1;
DWORD no_close_bar_style = AFX_DEFAULT_DOCKING_PANE_STYLE & ~AFX_CBRS_CLOSE & ~AFX_CBRS_FLOAT;
/*Creating pane*/
if(!mp_Tab1->Create(_T("Tab 1"), &m_TabsWnd, CRect(0, 0, 200, 200), TRUE,12345, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,AFX_CBRS_REGULAR_TABS, no_close_bar_style ))
{
TRACE0("Failed to create Pane\n");
return FALSE; // failed to create
}
m_TabsWnd.AddTab(mp_Tab1,_T("Tab 1"), (UINT)2,TRUE); //utceoppane.cpp (608) line:
I have the following code snippet in destructor of my class():
m_TabsWnd.RemoveAllTabs()
After running visual leak detector:
Leak Hash: 0xEB2A82CF, Count: 1, Total 72 bytes
Call Stack (TID 10512):
0x7744E0C6 (File and line number not available): ntdll.dll!RtlAllocateHeap
f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c (160): sample.exe!_malloc_dbg + 0x1B bytes
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxmem.cpp (379): sample.exe!operator new + 0x15 bytes
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxmem.cpp (80): sample.exe!CObject::operator new + 0x16 bytes
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxbasetabctrl.cpp (304): sample.exe!CMFCBaseTabCtrl::InsertTab + 0x11 bytes
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxbasetabctrl.cpp (254): sample.exe!CMFCBaseTabCtrl::AddTab
f:\workingarea\sourcecodes\release_versions\ver3_2_22\sample\utceoppane.cpp (608): sample.exe!CUtcEopPane::OnCreate + 0x33 bytes
So after calling RemoveAllTabs() also visual leak detector is showing hash leak pointing to the line m_TabsWnd.AddTab(mp_Tab1,_T("Tab 1"), (UINT)2,TRUE).
Please help me in order to solve the same.
Thanks & Regards,
Shweta B