Memory leak in an MFC application that use the CMFCRibbonBar::AddCategory method

  • Thread starter Thread starter ShiKaiChan
  • Start date Start date
S

ShiKaiChan

Guest
VC2010 Version:10.0.40219.1 SP1Rel

when MFC application uses "CMFCRibbonBar::AddCategory" to add new Category and "m_wndRibbonBar.RemoveAllCategories" to release memory,it will occur memory leak.


Code:

m_wndRibbonBar.AddCategory(temp,IDB_PNG_FOV_16,IDB_PNG_FOV_32,CSize(16,16),CSize(32,32));//memory add to 400K

m_wndRibbonBar.RemoveAllCategories;//memory release 300K



//"IDB_PNG_FOV_16"and"IDB_PNG_FOV_32" are PNG image,obviously memory is not freed (about 100K).

Continue reading...
 
Back
Top