diff --git a/eeschema/dialogs/panel_eeschema_color_settings.cpp b/eeschema/dialogs/panel_eeschema_color_settings.cpp index 5127e25594..71d1bdc1e1 100644 --- a/eeschema/dialogs/panel_eeschema_color_settings.cpp +++ b/eeschema/dialogs/panel_eeschema_color_settings.cpp @@ -106,7 +106,11 @@ PANEL_EESCHEMA_COLOR_SETTINGS::~PANEL_EESCHEMA_COLOR_SETTINGS() delete m_currentSettings; for( EDA_ITEM* item : m_previewItems ) + { + // Avoid referencing items after they are deleted (we don't control order) + item->SetParent( nullptr ); delete item; + } }