fix segfault when Update() is called inbetween mouse-up and mouse-down
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2379,6 +2379,7 @@ void wxAuiManager::GetDockSizeConstraint(double* width_pct, double* height_pct)
|
||||
void wxAuiManager::Update()
|
||||
{
|
||||
m_hover_button = NULL;
|
||||
m_action_part = NULL;
|
||||
|
||||
wxSizer* sizer;
|
||||
int i, pane_count = m_panes.GetCount();
|
||||
@@ -4182,6 +4183,9 @@ void wxAuiManager::OnLeftUp(wxMouseEvent& event)
|
||||
{
|
||||
m_hover_button = NULL;
|
||||
m_frame->ReleaseMouse();
|
||||
|
||||
if (m_action_part)
|
||||
{
|
||||
UpdateButtonOnScreen(m_action_part, event);
|
||||
|
||||
// make sure we're still over the item that was originally clicked
|
||||
@@ -4195,6 +4199,7 @@ void wxAuiManager::OnLeftUp(wxMouseEvent& event)
|
||||
ProcessMgrEvent(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_action == actionClickCaption)
|
||||
{
|
||||
m_frame->ReleaseMouse();
|
||||
@@ -4254,6 +4259,8 @@ void wxAuiManager::OnMotion(wxMouseEvent& event)
|
||||
|
||||
|
||||
if (m_action == actionResize)
|
||||
{
|
||||
if (m_action_part)
|
||||
{
|
||||
wxPoint pos = m_action_part->rect.GetPosition();
|
||||
if (m_action_part->orientation == wxHORIZONTAL)
|
||||
@@ -4270,6 +4277,7 @@ void wxAuiManager::OnMotion(wxMouseEvent& event)
|
||||
DrawResizeHint(dc, rect);
|
||||
m_action_hintrect = rect;
|
||||
}
|
||||
}
|
||||
else if (m_action == actionClickCaption)
|
||||
{
|
||||
int drag_x_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_X);
|
||||
@@ -4278,8 +4286,9 @@ void wxAuiManager::OnMotion(wxMouseEvent& event)
|
||||
// caption has been clicked. we need to check if the mouse
|
||||
// is now being dragged. if it is, we need to change the
|
||||
// mouse action to 'drag'
|
||||
if (abs(event.m_x - m_action_start.x) > drag_x_threshold ||
|
||||
abs(event.m_y - m_action_start.y) > drag_y_threshold)
|
||||
if (m_action_part &&
|
||||
(abs(event.m_x - m_action_start.x) > drag_x_threshold ||
|
||||
abs(event.m_y - m_action_start.y) > drag_y_threshold))
|
||||
{
|
||||
wxAuiPaneInfo* pane_info = m_action_part->pane;
|
||||
|
||||
|
Reference in New Issue
Block a user