Print Page | Close Window

Custom Grid Control: Memory Leak

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=5354
Printed Date: 11 November 2025 at 1:38pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom Grid Control: Memory Leak
Posted By: craig
Subject: Custom Grid Control: Memory Leak
Date Posted: 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);
}




Replies:
Posted By: craig
Date Posted: 24 October 2006 at 4:47pm
Poor man's UML class diagram.  Inheritance:


CXTPPropertyGridItem
        ^
        |
CRgbaPropertyGridItemColor
        ^
        |
CRgbaColorMenuGridItem





Posted By: Oleg
Date Posted: 25 October 2006 at 1:12am
Hi,
 
After TrackPopupMenu add
pColorBar->InternalrRelease();


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: craig
Date Posted: 25 October 2006 at 11:08am
Thanks Oleg.  Memory leak vanquished.  :)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net