Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Removing docking pane results in a crash
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Removing docking pane results in a crash

 Post Reply Post Reply
Author
Message
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Topic: Removing docking pane results in a crash
    Posted: 10 January 2007 at 9:36am
Hello,

I'm using some docking panes in my app and everything works fine until I close the app with some of the panes in a
collapsed floating state. For collapsed, floating panes, I get a crash inside CXTPDockingPaneMiniWnd::FindPane(). Here is the call stack
of the crash, beyond CMainFrame::OnClose(), where I call DestroyPane():

        ToolkitPro1040vc80D.dll!CXTPDockingPaneMiniWnd::FindPane(...)  Line 491 + 0x19 bytes    C++
     ToolkitPro1040vc80D.dll!CXTPDockingPaneMiniWnd::OnAction(...)  Line 756 + 0x1f bytes    C++
     ToolkitPro1040vc80D.dll!CXTPDockingPaneMiniWnd::OnPinButtonClick()  Line 777 + 0x16 bytes    C++
     ToolkitPro1040vc80D.dll!CXTPDockingPaneMiniWnd::RemovePane(...)  Line 179    C++
     ToolkitPro1040vc80D.dll!CXTPDockingPaneSplitterContainer::RemovePane(...)  Line 448 + 0x3b bytes    C++
     ToolkitPro1040vc80D.dll!CXTPDockingPaneLayout::_FreeEmptyPanes()  Line 685 + 0x22 bytes    C++
     ToolkitPro1040vc80D.dll!CXTPDockingPaneLayout::DestroyPane(...)  Line 962    C++
     ToolkitPro1040vc80D.dll!CXTPDockingPaneManager::DestroyPane(...)  Line 940    C++
     ToolkitPro1040vc80D.dll!CXTPDockingPaneManager::DestroyPane(int nID=4)  Line 1127    C++


I've found out that it's an 0xc0000005 access violation, because 'm_pTopContainer' is referenced in CXTPDockingPaneMiniWnd::FindPane(),
but it has been already set to NULL inside CXTPDockingPaneMiniWnd::RemovePane().

Where do you think lies the problem?

Thank you, in advance!

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 January 2007 at 9:48am
Hi,
What version you have?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
fatbone77 View Drop Down
Newbie
Newbie


Joined: 10 January 2007
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote fatbone77 Quote  Post ReplyReply Direct Link To This Post Posted: 10 January 2007 at 10:42pm
I encounter the same situation in V10.4. To repeat the problem, just click pin button on any floating pane, then click close button.
Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Posted: 11 January 2007 at 1:13am
Using the version 10.4 (currently porting our app from version 10.1, where  it was absolutely OK to destroy panes in CMainFrame::OnClose()).

I get the same crash with exactly the same call stack even in the "PaneSample" sample, if I modify the OnClose() handler from
this original code:
void CMainFrame::OnClose()
{
    // Save the current state for toolbars and menus.
    SaveCommandBars(_T("CommandBars"));
    CMDIFrameWnd::OnClose();
}


to this modified code:
void CMainFrame::OnClose()
{
    // Save the current state for toolbars and menus.
    SaveCommandBars(_T("CommandBars"));
    m_paneManager.DestroyPane(IDR_PANE2);
    CMDIFrameWnd::OnClose();
}



Run the sample app and before you close it, make sure pane2 is a collapsed floating pane.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 January 2007 at 2:14am
Hello,
 
Yes, sorry, we agree this problem of 10.4 and will fix if for 10.4.1.
 
Please Add to CXTPDockingPaneMiniWnd::FindPane method:
 
if (!m_pTopContainer) return;
 
and rebuild library.
 
 
Thank you for let us know.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Posted: 11 January 2007 at 2:24am
Thank you for the fix provided.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.234 seconds.