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
This commit is contained in:
Jonatan Liljedahl 2019-12-19 10:45:24 +01:00 committed by Seth Hillbrand
parent d9de28de35
commit 1e42d6abeb
1 changed files with 3 additions and 1 deletions

View File

@ -170,10 +170,12 @@ void LIB_TREE_MODEL_ADAPTER::UpdateSearchString( wxString const& aSearch )
m_widget->UnselectAll(); m_widget->UnselectAll();
Cleared(); Cleared();
#ifndef __WINDOWS__ #if defined( __LINUX__ )
// The fastest method to update wxDataViewCtrl is to rebuild from // The fastest method to update wxDataViewCtrl is to rebuild from
// scratch by calling Cleared(). Linux requires to reassociate model to // scratch by calling Cleared(). Linux requires to reassociate model to
// display data, but Windows will create multiple associations. // 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 ); AttachTo( m_widget );
#endif #endif
} }