Print Page | Close Window

Tear off window causes crash on exit

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=24309
Printed Date: 24 June 2024 at 3:39am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Tear off window causes crash on exit
Posted By: rconn
Subject: Tear off window causes crash on exit
Date Posted: 24 July 2022 at 4:12pm
Using Toolkit Pro 20.3, Visual Studio 2022, Windows 11.

When I enable tear off windows, tear one off, and then close the main client window the app will crash in CXTPTearOffFrame::DestroyWindow(). A bad pointer is returned from:

    CXTPTabClientWnd* pPrevTab = (CXTPTabClientWnd*)m_wndTabClient.m_lstPrevTab.GetHead();

If I close the tear off window first, then close the main client window I don't get the crash.

Anybody else seen this?  Is there a workaround?




Replies:
Posted By: agontarenko
Date Posted: 28 July 2022 at 4:11am
Hello,

Unfortunately it is not clear what exactly is going wrong.
If it cannot be re-produced in any of our sample applications provided I would appreciate you sending a small code snippet or ideally a sample application so that we could debug it.

Regards,
Artem Gontarenko


Posted By: jw_statica
Date Posted: 08 December 2022 at 3:35am
I have the same issue with ToolKitPro 22.0.0. I was testing the sample project RibbonResource. 
Steps:
1. In function CMainFrame::OnCreate add one line m_wndTabClient.EnableTearOff(). 
2. Open a few tabs.
3. Tear-off one of opened tabs.
4. Close application.
5. We have crash mentioned in topic CXTPTearOfFrame::DestroyWindow().


Posted By: jw_statica
Date Posted: 09 December 2022 at 5:11am
Have you reproduced this issue?


Posted By: xsensordev
Date Posted: 20 December 2022 at 6:19pm
This may or may not work for you. It works for me as of Toolkit Pro 20.3.0

In CMainFrame::OnClose(), I call CXTPTabClientWnd::CloseAllTearOffFrames().

My CMainFrame's CXTPTabClientWnd member is _MTIClientWnd.


void CMainFrame::OnClose()
{
    if(_MTIClientWnd.GetItemCount() > 0)
        _MTIClientWnd.CloseAllTearOffFrames();

    _MTIClientWnd.Detach();

    CXTPMDIFrameWndEx::OnClose();
}


Posted By: jw_statica
Date Posted: 21 December 2022 at 5:02am
It works for me too :-) Thank you for response ;)


Posted By: xsensordev
Date Posted: 23 December 2022 at 12:24pm
You're welcome, happy holidays!



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