Print Page | Close Window

XTSplitterWnd and Cleanup

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=730
Printed Date: 17 June 2024 at 12:28pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: XTSplitterWnd and Cleanup
Posted By: MarcoNedwig
Subject: XTSplitterWnd and Cleanup
Date Posted: 13 May 2004 at 5:04pm

I have a problem using XTSplitterWnd. When I call ReplaceView fiunction the old view is only set to SW_HIDE to activate another view with SW_SHOW. But the old view won't be destroyed and so the application has a memory leak, because the old view isn't set active anymore and memory stays allocated

I solved the problem by doing pOldView->DestroyWindow at the end of the function, but this causes any function at the old view (like OnKillFocus methods) will cause errors, because the view doesn't exist anymore.

My actual way is saving the return value of ReplaceView ( which is the pointer to the old view set to SW_HIDE) and call destroy window after a while ( 30 s). This causes an endless loops after a while( Perhaps a recursive call in DestroyWindow implementation of the MFC). This can be seen with WIN NT 4. WIN 2000 doesn't seem to have this behaviour?

Does anyone has a suggestion or a solution for me?




Replies:
Posted By: thodgson
Date Posted: 11 September 2004 at 5:06pm
I am using ReplaceView in my application and was wondering if this issue has been addressed.



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