From 1684fc735a83ef33db1a45c78d2a413179abc0a7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 16 Mar 2018 19:01:50 +0000 Subject: [PATCH] Defensive coding to attempt to prevent wxWidgets crash. Fixes: lp:1756255 * https://bugs.launchpad.net/kicad/+bug/1756255 --- eeschema/cmp_tree_model_adapter_base.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eeschema/cmp_tree_model_adapter_base.cpp b/eeschema/cmp_tree_model_adapter_base.cpp index 0095bbb1ba..81d61e954c 100644 --- a/eeschema/cmp_tree_model_adapter_base.cpp +++ b/eeschema/cmp_tree_model_adapter_base.cpp @@ -177,6 +177,12 @@ void CMP_TREE_MODEL_ADAPTER_BASE::UpdateSearchString( wxString const& aSearch ) { wxWindowUpdateLocker updateLock( m_widget ); + // 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(); + Cleared(); #ifndef __WINDOWS__ // The fastest method to update wxDataViewCtrl is to rebuild from