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.
This commit is contained in:
Jeff Young 2018-03-19 12:13:00 +00:00
parent 5e34563f52
commit 1a845bc4ad
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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() )
{