X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6c37f5bc40dc01ba7a0db6c50a79d88bdd028c7..db414879d45f5da2be534a0f523b0506f2ab1183:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 6cd893542d..37d21463a4 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -791,6 +791,8 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxTreeCtrl::~wxTreeCtrl() { + m_isBeingDeleted = true; + // delete any attributes if ( m_hasAnyAttr ) { @@ -3468,7 +3470,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // // to avoid such surprises, we force the generation of focus events // now, before we generate the selection change ones - if ( !m_changingSelection ) + if ( !m_changingSelection && !m_isBeingDeleted ) SetFocus(); break;