]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed crash due to infinite recursion in wxPopupFocusHandler::OnKeyDown()
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 Nov 2006 14:01:39 +0000 (14:01 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 Nov 2006 14:01:39 +0000 (14:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/popupcmn.cpp

index 143dff26350a40d3530b6dfd1ff2597aba27c73b..8fc32bcc50f56547bc0b65627b54a40e9c64d543 100644 (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) )
     {