From bd60f38569f47cd0ff91c8029d1b51da61061e64 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 3 Apr 2023 18:09:21 +0100 Subject: [PATCH] Possible protection from acessing deleted window data. (Long shot for Sentry KICAD-MM.) --- eeschema/symbol_editor/symbol_edit_frame.h | 9 ++++++++- pcbnew/footprint_edit_frame.cpp | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/eeschema/symbol_editor/symbol_edit_frame.h b/eeschema/symbol_editor/symbol_edit_frame.h index 216bbeb499..b363f26a21 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.h +++ b/eeschema/symbol_editor/symbol_edit_frame.h @@ -247,7 +247,14 @@ public: UpdateSymbolMsgPanelInfo(); } - bool IsSymbolFromSchematic() const { return m_isSymbolFromSchematic; } + bool IsSymbolFromSchematic() const + { + // If we've already vetted closing this window, then we have no symbol anymore + if( m_isClosing ) + return false; + + return m_isSymbolFromSchematic; + } bool IsSymbolFromLegacyLibrary() const; diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index b5c1a0851f..97fa4e93db 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -494,6 +494,10 @@ void FOOTPRINT_EDIT_FRAME::ClearModify() bool FOOTPRINT_EDIT_FRAME::IsCurrentFPFromBoard() const { + // If we've already vetted closing this window, then we have no FP anymore + if( m_isClosing ) + return false; + FOOTPRINT* footprint = GetBoard()->GetFirstFootprint(); return ( footprint && footprint->GetLink() != niluuid );