Memory leak in modeless CXTPPropertySheet? |
Post Reply |
Author | |
nick_w
Newbie Joined: 15 July 2010 Status: Offline Points: 4 |
Post Options
Thanks(0)
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
nick_w
Newbie Joined: 15 July 2010 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
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.
|
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
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 (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
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 |