User forums > Help

crash: codeblocks wx2.6.1 unicode

(1/5) > >>

grv575:
Crash on exiting codeblocks.  rpt file attached.  Crashes in processing wx event to resize the splitter.  If I comment out
sdk\xtra_classes.cpp:

--- Code: ---void wxSplitPanel::RefreshSplitter(int idtop,int idbottom,int sashPosition)
{
/*
    wxWindow *topwin = m_splitter->FindWindowById(idtop);
    wxWindow *bottomwin = m_splitter->FindWindowById(idbottom);
    int oldsash = m_splitter->GetSashPosition();
    m_splitter->Freeze();
    if(topwin && topwin->IsShown() && bottomwin && bottomwin->IsShown())
    {
        m_splitter->SplitHorizontally(topwin,bottomwin);
    }
    else
    {
        wxWindow* thewin = 0;
        if (topwin && topwin->IsShown())
            thewin = topwin;
        else if (bottomwin && bottomwin->IsShown())
            thewin = bottomwin;
        m_splitter->Initialize(thewin);
    }
    if (sashPosition)
    {
        m_splitter->SetSashPosition(sashPosition);
    }
    else
    {
        if (!m_SplitterConfig.IsEmpty())
            m_splitter->SetSashPosition(ConfigManager::Get()->Read(m_SplitterConfig, (long int)150));
        else
            m_splitter->SetSashPosition(oldsash);
    }
    m_splitter->Thaw();
    *////
}

--- End code ---

then no crash on exit.  The splitter of course doesn't refresh, but hopefully this isolates it somewhat.  Thinking that a refresh event gets queued and then the application thread exits, while wx dll tries to process event on nonexistant splitter.  Maybe debug code can be added to that method above to check for nulls.


[attachment deleted by admin]

rickg22:
Hmmmm makes me wonder.

Try enabling the new "crash protection" option on environment settings.

grv575:
OK, something wrong with the logic involving topwin and bottomwin.  Maybe a conditional breakpoint on m_splitter->Initialize(thewin); when topwin==0 or bottomwin==0.  Not positive.  The following works without crashing though (might not be correct desired code however).  Changes marked ///:


--- Code: ---void wxSplitPanel::RefreshSplitter(int idtop,int idbottom,int sashPosition)
{
    wxWindow *topwin = m_splitter->FindWindowById(idtop);
    wxWindow *bottomwin = m_splitter->FindWindowById(idbottom);
   
    if (!topwin || !bottomwin)///
        return;///
   
    int oldsash = m_splitter->GetSashPosition();
    m_splitter->Freeze();
    if(topwin && topwin->IsShown() && bottomwin && bottomwin->IsShown())
    {
        m_splitter->SplitHorizontally(topwin,bottomwin);
    }
    else
    {
        wxWindow* thewin = 0;
        if (topwin && topwin->IsShown())
            thewin = topwin;
        else if (bottomwin && bottomwin->IsShown())
            thewin = bottomwin;
        m_splitter->Initialize(thewin);
    }
    if (sashPosition)
    {
        m_splitter->SetSashPosition(sashPosition);
    }
    else
    {
        if (!m_SplitterConfig.IsEmpty())
            m_splitter->SetSashPosition(ConfigManager::Get()->Read(m_SplitterConfig, (long int)150));
        else
            m_splitter->SetSashPosition(oldsash);
    }
    m_splitter->Thaw();
}

--- End code ---

rickg22:
I think that should be


--- Code: ---if(!topwin && !bottomwin) return;
--- End code ---

Anyway did you check out my post regarding the "crash protection" option?

grv575:
What does crash protection do?  Didn't prevent a crash btw.  Same rpt backtrace as well.

yeah !topwin && !bottomwin looks right.  problem is that having either of those lines (|| or &&) prevents it from crashing if the splitter is on
the Projects tab, but if the splitter is on the Watches tab, I still get the crash.

edit: actually it can still crash even with the !top/bottomwindow stuff.  looks event related.  but definately no crashes if I comment out the contents of RefreshSplitter.

Navigation

[0] Message Index

[#] Next page

Go to full version