Print Page | Close Window

CXTPTabControl Memory Problem !!!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=21776
Printed Date: 29 April 2024 at 1:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTabControl Memory Problem !!!
Posted By: shanmuganathan
Subject: CXTPTabControl Memory Problem !!!
Date Posted: 06 July 2013 at 4:57am
Created a SDI application with a XT Splitter control, in which we created a CHtmlView with tabs using "CXTPTabControl" to load the web pages.

Step 1:
Memory of my application increases whenever we create or add a new tab.

Step 2: 
Close all the tabs except one tab.

Problem:
The memory of application just reduces only 40% compared to the previous memory state.

Please let me know what i am doing wrong (or) what we need to do to bring the memory of my application to a same state even after closing all the tabs.

==================== CODE==================== 
void CMyBrowserTabView::OnCloseOtherTabs()
{
CXTPTabManagerItem* pItem = NULL;
CXTPTabManagerItem* pCurrentItem = NULL;

//m_XTPTabControl is object of CXTPTabControl
if( m_XTPTabControl.GetSafeHwnd() )
{
pCurrentItem = m_XTPTabControl.GetSelectedItem();
CXTPTabManagerItem* pItem = NULL;
HWND hWnd = NULL;

for(int iter = m_XTPTabControl.GetItemCount()-2; iter>=0; iter-- )
{
pItem = m_XTPTabControl.GetItem(iter);

if( pItem != pCurrentItem )
{
CMYBrowserView *pView = NULL;
pView = (CMYBrowserView*)CWnd::FromHandle(pItem->GetHandle());

if(pView)
{
pView->Stop();
pItem->Remove();
pView->SetTabItem(NULL);

delete pView;
pView = NULL;
}
}
}
}
}
==================== Version  Info===================
Xtreme ToolkitPro v15.0.2
Visual Studio 2008
Windows 8 OS

Thanks In Advance.





Replies:
Posted By: shanmuganathan
Date Posted: 11 July 2013 at 1:14am
And even in the version (Xtreme ToolkitPro v15.0.2) we use we can see lot of memory leaks are pointed out in the codejock classes.

Just a simple technique from the below link can be used by others to figure out the same.

http://msdn.microsoft.com/en-us/library/e5ewb1h3(v=vs.80).aspx.







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