From 4c99fdfaf4ff2aa68389e7f4f6b4a835415c883c Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 5 Aug 2013 17:10:58 +0000 Subject: [PATCH] prevent infinite loop if gtk_menu_popup() fails, fixes #15387 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 0285a47912..d535b232da 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -4368,6 +4368,13 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y ) gtk_get_current_event_time() ); + // it is possible for gtk_menu_popup() to fail + if (!gtk_widget_get_visible(GTK_WIDGET(menu->m_menu))) + { + menu->m_popupShown = false; + return false; + } + while (menu->m_popupShown) { gtk_main_iteration(); -- 2.45.2