![]() |
Custom Grid Control: Memory Leak |
Post Reply
|
| Author | |
craig
Groupie
Joined: 11 August 2005 Location: United States Status: Offline Points: 44 |
Post Options
Thanks(0)
Quote Reply
Topic: Custom Grid Control: Memory LeakPosted: 24 October 2006 at 4:44pm |
|
I've created a custom grid control that is leaking CXTPPopupBars. Is there a reason why this code would be leaking the pColorBar instead of automatically being freed by the Codejock framework?
void CRgbaColorMenuGridItem::OnInplaceButtonDown() { CRect rcItem= GetItemRect(); m_pGrid->ClientToScreen(&rcItem); rcItem.left = rcItem.right - 158; // small hack. need to add CPS_XT_LEFTALLIGN // Bar to contain the controls CXTPPopupBar* pColorBar = (CXTPPopupBar*)CXTPPopupBar::CreateObject(); pColorBar->SetFlags(xtpThemeOfficeXP); CXTPCommandBars::TrackPopupMenu(pColorBar, 0, rcItem.left, rcItem.bottom, m_pMsgWnd, NULL, m_pMsgWnd); } |
|
![]() |
|
craig
Groupie
Joined: 11 August 2005 Location: United States Status: Offline Points: 44 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 October 2006 at 4:47pm |
|
Poor man's UML class diagram. Inheritance:
CXTPPropertyGridItem ^ | CRgbaPropertyGridItemColor ^ | CRgbaColorMenuGridItem |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 October 2006 at 1:12am |
|
Hi,
After TrackPopupMenu add
pColorBar->InternalrRelease();
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
craig
Groupie
Joined: 11 August 2005 Location: United States Status: Offline Points: 44 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 October 2006 at 11:08am |
|
Thanks Oleg. Memory leak vanquished. :)
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |