From: Vadim Zeitlin Date: Fri, 2 Dec 2011 00:50:35 +0000 (+0000) Subject: Fix reentrancy in wxDataViewRendererBase::FinishEditing(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4d7bc8e761ff8a269d066a46ef3bba7c02e3e0e9 Fix reentrancy in wxDataViewRendererBase::FinishEditing(). Switching focus to the main wxDataViewCtrl window resulted in focus loss event and a reentrant call to FinishEditing() itself if it wasn't called because the in-place edit control was being destroyed the first time. Fix this by destroying the in-place control first and adjusting the focus later, the effect should be exactly the same but now FinishEditing() can be safely called from anywhere in the code. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index ad62ddae04..1dde0aadd1 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -760,10 +760,10 @@ bool wxDataViewRendererBase::FinishEditing() wxDataViewCtrl* dv_ctrl = GetOwner()->GetOwner(); - dv_ctrl->GetMainWindow()->SetFocus(); - DestroyEditControl(); + dv_ctrl->GetMainWindow()->SetFocus(); + bool isValid = Validate(value); unsigned int col = GetOwner()->GetModelColumn();