From e3b507e93e3751ebcec5a1881ffe9558d78dfbf5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 11 Apr 2013 16:54:41 +0000 Subject: [PATCH] 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 --- src/common/combocmn.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index c2f01598e2..b055549416 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -389,7 +389,7 @@ void wxComboFrameEventHandler::OnIdle( wxIdleEvent& event ) wxWindow* popup = m_combo->GetPopupControl()->GetControl(); wxWindow* winpopup = m_combo->GetPopupWindow(); - if ( + if ( !winFocused || ( winFocused != m_focusStart && winFocused != popup && winFocused->GetParent() != popup && @@ -398,6 +398,7 @@ void wxComboFrameEventHandler::OnIdle( wxIdleEvent& event ) winFocused != m_combo && winFocused != m_combo->GetButton() // GTK (atleast) requires this ) + ) { m_combo->HidePopup(true); } -- 2.47.2