Check that focused window is non-NULL before using it in wxComboCtrl.

wxWindow::FindFocus() may return NULL, don't crash by attempting to
dereference the pointer returned by it.

Closes #15146.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2013-04-11 16:54:41 +00:00
parent 5ae1a66970
commit e3b507e93e

View File

@ -389,7 +389,7 @@ void wxComboFrameEventHandler::OnIdle( wxIdleEvent& event )
wxWindow* popup = m_combo->GetPopupControl()->GetControl(); wxWindow* popup = m_combo->GetPopupControl()->GetControl();
wxWindow* winpopup = m_combo->GetPopupWindow(); wxWindow* winpopup = m_combo->GetPopupWindow();
if ( if ( !winFocused || (
winFocused != m_focusStart && winFocused != m_focusStart &&
winFocused != popup && winFocused != popup &&
winFocused->GetParent() != popup && winFocused->GetParent() != popup &&
@ -398,6 +398,7 @@ void wxComboFrameEventHandler::OnIdle( wxIdleEvent& event )
winFocused != m_combo && winFocused != m_combo &&
winFocused != m_combo->GetButton() // GTK (atleast) requires this winFocused != m_combo->GetButton() // GTK (atleast) requires this
) )
)
{ {
m_combo->HidePopup(true); m_combo->HidePopup(true);
} }