fixed crash due to infinite recursion in wxPopupFocusHandler::OnKeyDown()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2006-11-04 14:01:39 +00:00
parent 86020f7e33
commit 1295f134ed

View File

@ -34,6 +34,8 @@
#include "wx/log.h"
#endif //WX_PRECOMP
#include "wx/recguard.h"
#ifdef __WXUNIVERSAL__
#include "wx/univ/renderer.h"
#include "wx/scrolbar.h"
@ -561,6 +563,16 @@ void wxPopupFocusHandler::OnKillFocus(wxFocusEvent& event)
void wxPopupFocusHandler::OnKeyDown(wxKeyEvent& event)
{
// we can be associated with the popup itself in which case we should avoid
// infinite recursion
static int s_inside;
wxRecursionGuard guard(s_inside);
if ( guard.IsInside() )
{
event.Skip();
return;
}
// let the window have it first, it might process the keys
if ( !m_popup->GetEventHandler()->ProcessEvent(event) )
{