- Code: Select all
void wxFrameManager::OnFloatingPaneMoving(wxWindow* wnd)
Being called, which executes this line
- Code: Select all
wxPoint frame_pos = pane.frame->GetPosition();
And the pane.frame has already been set to NULL
So I added:
- Code: Select all
virtual bool Destroy ()
{
m_pane_window = NULL;
return wxFloatingPaneBaseClass::Destroy();
}
to wxFloatingPane
Then on the events I return early if it is NULL instead of calling m_owner_mgr->OnFloatingPaneMoveStart(m_pane_window);
- Code: Select all
void OnMoveStart()
{
if (m_pane_window == NULL)
return;
// notify the owner manager that the pane has started to move
m_owner_mgr->OnFloatingPaneMoveStart(m_pane_window);
}
void OnMoving(const wxRect& window_rect)
{
if (m_pane_window == NULL)
return;
// notify the owner manager that the pane is moving
m_owner_mgr->OnFloatingPaneMoving(m_pane_window);
}
void OnMoveFinished()
{
if (m_pane_window == NULL)
return;
// notify the owner manager that the pane has finished moving
m_owner_mgr->OnFloatingPaneMoved(m_pane_window);
}
void OnActivate(wxActivateEvent& event)
{
if (m_pane_window == NULL)
return;
if (event.GetActive())
{
m_owner_mgr->OnFloatingPaneActivated(m_pane_window);
}
}
...
void OnSize(wxSizeEvent& event)
{
if (m_pane_window == NULL)
return;
m_owner_mgr->OnFloatingPaneResized(m_pane_window, event.GetSize());
}
void OnClose(wxCloseEvent& event)
{
if (m_pane_window == NULL)
{
Destroy();
return;
}
m_owner_mgr->OnFloatingPaneClosed(m_pane_window);
Destroy();
}
The protection could be put in several places, It could be put higher up, like OnMouseEvent, but then it loses its meaning and could accidently removed, or called around it by a new function. It could be moved lower, Pre-Condition checks that fail silently but I wanted my changes isolated so I could keep track of them better.
Sorry no patches, its simple and I am not too familiar with patch programs (I haven't had the opportunity to contribute back too much in the past).