From 9db177273906bb393b97b4a98f6a8b4d61e8f0e3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 24 Oct 2012 18:22:39 +0000 Subject: [PATCH] Don't call wxSafeYield() from wxGenericListCtrl::EditLabel(). This could result in wxYield() reentrancy and while it could be avoided by using wxSafeYield(NULL, true /* only if needed */) it seems that we don't actually need to yield here at all and a simple Update() should be enough. Closes #14727. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 2b74874690..363cfa40f8 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2238,19 +2238,10 @@ wxTextCtrl *wxListMainWindow::EditLabel(long item, wxClassInfo* textControlClass return NULL; } - // We have to call this here because the label in question might just have - // been added and no screen update taken place. if ( m_dirty ) { - // TODO: use wxTheApp->SafeYieldFor(NULL, wxEVT_CATEGORY_UI) instead - // so that no pending events may change the item count (see below) - // IMPORTANT: needs to be tested! - wxSafeYield(); - - // Pending events dispatched by wxSafeYield might have changed the item - // count - if ( (size_t)item >= GetItemCount() ) - return NULL; + // Ensure the display is updated before we start editing. + Update(); } wxTextCtrl * const text = (wxTextCtrl *)textControlClass->CreateObject(); -- 2.45.2