eeschema: lock model while updating scores
The tree model adapter appears to have update issues when modifying the scores while it _might_ get updated. This moves the lock higher and removes the extraneous Freeze/Thaw call. Unfortunately, this only exposes an additional issue in the tool handler but this will hopefully be easier to debug. Fixes https://gitlab.com/kicad/code/kicad/issues/5206
This commit is contained in:
parent
e2bdd34d82
commit
6b0176d577
|
@ -188,6 +188,9 @@ void LIB_TREE_MODEL_ADAPTER::DoAddLibrary( wxString const& aNodeName, wxString c
|
|||
|
||||
void LIB_TREE_MODEL_ADAPTER::UpdateSearchString( wxString const& aSearch )
|
||||
{
|
||||
{
|
||||
wxWindowUpdateLocker updateLock( m_widget );
|
||||
|
||||
m_tree.ResetScore();
|
||||
|
||||
for( auto& child: m_tree.m_Children )
|
||||
|
@ -206,20 +209,14 @@ void LIB_TREE_MODEL_ADAPTER::UpdateSearchString( wxString const& aSearch )
|
|||
m_tree.UpdateScore( matcher );
|
||||
}
|
||||
|
||||
m_tree.SortNodes();
|
||||
|
||||
{
|
||||
wxWindowUpdateLocker updateLock( m_widget );
|
||||
|
||||
Freeze();
|
||||
// Even with the updateLock, wxWidgets sometimes ties its knickers in
|
||||
// a knot when trying to run a wxdataview_selection_changed_callback()
|
||||
// on a row that has been deleted.
|
||||
// https://bugs.launchpad.net/kicad/+bug/1756255
|
||||
m_widget->UnselectAll();
|
||||
|
||||
m_tree.SortNodes();
|
||||
Cleared();
|
||||
Thaw();
|
||||
|
||||
// This was fixed in wxWidgets 3.0.5 and 3.1.3.
|
||||
#if defined( __WXGTK__ ) && ( (wxVERSION_NUMBER < 030005 ) || \
|
||||
|
|
Loading…
Reference in New Issue