From 1e42d6abeb420af96a9bd5c30abc6ec29f8f9a9f Mon Sep 17 00:00:00 2001 From: Jonatan Liljedahl Date: Thu, 19 Dec 2019 10:45:24 +0100 Subject: [PATCH] symbol-editor: Fix MacOS segfault in lib_tree_model_adapter In LIB_TREE_MODEL_ADAPTER::UpdateSearchString(), don't call AttachTo() on MacOS. Fixes https://gitlab.com/kicad/code/kicad/issues/3653 and https://gitlab.com/kicad/code/kicad/issues/3666 --- common/lib_tree_model_adapter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/lib_tree_model_adapter.cpp b/common/lib_tree_model_adapter.cpp index d378775f4b..90c464121b 100644 --- a/common/lib_tree_model_adapter.cpp +++ b/common/lib_tree_model_adapter.cpp @@ -170,10 +170,12 @@ void LIB_TREE_MODEL_ADAPTER::UpdateSearchString( wxString const& aSearch ) m_widget->UnselectAll(); Cleared(); -#ifndef __WINDOWS__ +#if defined( __LINUX__ ) // The fastest method to update wxDataViewCtrl is to rebuild from // scratch by calling Cleared(). Linux requires to reassociate model to // display data, but Windows will create multiple associations. + // On MacOS, this crashes kicad. See https://gitlab.com/kicad/code/kicad/issues/3666 + // and https://gitlab.com/kicad/code/kicad/issues/3653 AttachTo( m_widget ); #endif }