From be7cf117a5138f0fa56e1afc8be27d6cb6611bc7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 27 Jul 2025 22:32:37 +0100 Subject: [PATCH] Shutdown safety (KICAD-N5Y). (cherry picked from commit 59caea434421b3466efd07fb86391c22bc03c285) --- eeschema/widgets/search_handlers.h | 3 +++ include/eda_base_frame.h | 2 ++ pcbnew/widgets/search_handlers.h | 3 +++ 3 files changed, 8 insertions(+) diff --git a/eeschema/widgets/search_handlers.h b/eeschema/widgets/search_handlers.h index 8cc955d210..b0a474cbcc 100644 --- a/eeschema/widgets/search_handlers.h +++ b/eeschema/widgets/search_handlers.h @@ -48,6 +48,9 @@ public: wxString GetResultCell( int aRow, int aCol ) override { + if( m_frame->IsClosing() ) + return wxEmptyString; + if( aRow >= static_cast( m_hitlist.size() ) ) return wxEmptyString; diff --git a/include/eda_base_frame.h b/include/eda_base_frame.h index 127616fd06..44d8affc36 100644 --- a/include/eda_base_frame.h +++ b/include/eda_base_frame.h @@ -589,6 +589,8 @@ public: */ virtual void OnModify(); + bool IsClosing() const { return m_isClosing; } + bool NonUserClose( bool aForce ) { m_isNonUserClose = true; diff --git a/pcbnew/widgets/search_handlers.h b/pcbnew/widgets/search_handlers.h index e89e1ee03f..0858a2b804 100644 --- a/pcbnew/widgets/search_handlers.h +++ b/pcbnew/widgets/search_handlers.h @@ -39,6 +39,9 @@ public: wxString GetResultCell( int aRow, int aCol ) override { + if( m_frame->IsClosing() ) + return wxEmptyString; + if( aRow >= static_cast(m_hitlist.size() ) ) return wxEmptyString;