diff --git a/src/generic/headerctrlg.cpp b/src/generic/headerctrlg.cpp index e723d677b3..7382fb47ad 100644 --- a/src/generic/headerctrlg.cpp +++ b/src/generic/headerctrlg.cpp @@ -93,6 +93,11 @@ void wxHeaderCtrl::DoSetCount(unsigned int count) m_numColumns = count; + // don't leave the column index invalid, this would cause a crash later if + // it is used from OnMouse() + if ( m_hover >= count ) + m_hover = COL_NONE; + InvalidateBestSize(); Refresh(); }