Print Page | Close Window

Memory leak in modeless CXTPPropertySheet?

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=17059
Printed Date: 15 May 2024 at 8:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Memory leak in modeless CXTPPropertySheet?
Posted By: nick_w
Subject: Memory leak in modeless CXTPPropertySheet?
Date Posted: 03 August 2010 at 2:24pm

I was testing modeless property sheet in CPropertySheetDlg::OnButtonTree() of PropertySheetDlg sample project. After I close the main window, I noticed there was memory leak for not deleting a CSamplePropertySheet object. So I called DestroyWindow()at window close but the memory leak was still there.

Any advice? Thanks.




Replies:
Posted By: Oleg
Date Posted: 05 August 2010 at 5:41am
Hi,

You need manually delete pointer to ps. You can add member in your class and delete it in destructor.

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


Posted By: nick_w
Date Posted: 09 August 2010 at 12:04pm
I did.
 
I have this in destructor
 

CPropertySheetDlg::~CPropertySheetDlg()

{

if ( m_pModelLessSheet )

{

delete m_pModelLessSheet->pNavigator;

m_pModelLessSheet->DestroyWindow();

m_pModelLessSheet = NULL;

}

}

if I add   delete m_pModelLessSheet;     
after destroy window, it will crash.
 
Originally posted by oleg oleg wrote:

Hi,

You need manually delete pointer to ps. You can add member in your class and delete it in destructor.


Posted By: cpede
Date Posted: 14 December 2010 at 4:05am
Could it be that you need to do this, using the good old way by calling delete this in WM_NCDESTROY ?
 
-cpede


-------------
Product: Xtreme ToolkitPro (22.1.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)



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