From 1a845bc4ad7f0d475cd57cb3dbdfb14f5eb55c82 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 19 Mar 2018 12:13:00 +0000 Subject: [PATCH] Safer way to commit in-progress changes in wxGrid. In some cases the wxGrid would attempt to close the editor in the middle of the d'tor, resulting in segfaults. --- eeschema/dialogs/dialog_sym_lib_table.cpp | 4 ++-- pcbnew/dialogs/dialog_fp_lib_table.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eeschema/dialogs/dialog_sym_lib_table.cpp b/eeschema/dialogs/dialog_sym_lib_table.cpp index 8e49fbc701..39303ec1e0 100644 --- a/eeschema/dialogs/dialog_sym_lib_table.cpp +++ b/eeschema/dialogs/dialog_sym_lib_table.cpp @@ -550,8 +550,8 @@ void DIALOG_SYMBOL_LIB_TABLE::moveDownHandler( wxCommandEvent& event ) bool DIALOG_SYMBOL_LIB_TABLE::TransferDataFromWindow() { - // stuff any pending cell editor text into the table. - m_cur_grid->SaveEditControlValue(); + // Commit any pending in-place edits and close the editor + m_cur_grid->DisableCellEditControl(); if( !wxDialog::TransferDataFromWindow() || !verifyTables() ) return false; diff --git a/pcbnew/dialogs/dialog_fp_lib_table.cpp b/pcbnew/dialogs/dialog_fp_lib_table.cpp index d77e15253b..e0c5aaabad 100644 --- a/pcbnew/dialogs/dialog_fp_lib_table.cpp +++ b/pcbnew/dialogs/dialog_fp_lib_table.cpp @@ -582,7 +582,7 @@ private: int dialogRet = 0; // stuff any pending cell editor text into the table. - m_cur_grid->SaveEditControlValue(); + m_cur_grid->DisableCellEditControl(); if( verifyTables() ) {