]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't call wxSafeYield() from wxGenericListCtrl::EditLabel().
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Oct 2012 18:22:39 +0000 (18:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Oct 2012 18:22:39 +0000 (18:22 +0000)
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

index 2b7487469042e1d382c130d25badc9bc95d358ec..363cfa40f88f94734dd927760f0b0838b5d14dde 100644 (file)
@@ -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();