From 15a094c647d28588c46f9301f514040daf51e03d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 25 Jun 2021 17:41:34 +0100 Subject: [PATCH] Give CVPCB its own footprint info list. There's a smoking gun on Mac Big Sur that suggests that sharing the table between binaries may be corrupting the heap. Fixes https://gitlab.com/kicad/code/kicad/issues/8657 --- cvpcb/CMakeLists.txt | 1 + cvpcb/cvpcb_mainframe.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cvpcb/CMakeLists.txt b/cvpcb/CMakeLists.txt index 43d1f2c555..ce7ef26ab8 100644 --- a/cvpcb/CMakeLists.txt +++ b/cvpcb/CMakeLists.txt @@ -27,6 +27,7 @@ set( CVPCB_DIALOGS set( CVPCB_SRCS ${CMAKE_SOURCE_DIR}/common/base_units.cpp ${CMAKE_SOURCE_DIR}/pcbnew/board_stackup_manager/stackup_predefined_prms.cpp + ${CMAKE_SOURCE_DIR}/pcbnew/footprint_info_impl.cpp auto_associate.cpp components_listbox.cpp display_footprints_frame.cpp diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index 7937562053..bfeb40edda 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,12 @@ #define CVPCB_MAINFRAME_NAME wxT( "CvpcbFrame" ) +/// The global footprint info table. This is performance-intensive to build so we +/// keep a hash-stamped global version. Any deviation from the request vs. stored +/// hash will result in it being rebuilt. +FOOTPRINT_LIST_IMPL GFootprintList; + + CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) : KIWAY_PLAYER( aKiway, aParent, FRAME_CVPCB, _( "Assign Footprints" ), wxDefaultPosition, wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, CVPCB_MAINFRAME_NAME ) @@ -71,7 +78,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) : m_skipComponentSelect = false; m_filteringOptions = FOOTPRINTS_LISTBOX::UNFILTERED_FP_LIST; m_tcFilterString = NULL; - m_FootprintsList = FOOTPRINT_LIST::GetInstance( Kiway() ); + m_FootprintsList = &GFootprintList; m_initialized = false; m_aboutTitle = "CvPcb"; @@ -89,6 +96,8 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) : ReCreateMenuBar(); ReCreateHToolbar(); + GFootprintList.ReadCacheFromFile( Prj().GetProjectPath() + "fp-info-cache" ); + // Create list of available footprints and symbols of the schematic BuildSymbolsListBox(); BuildFootprintsListBox();