← Back to team overview

kicad-developers team mailing list archive

[PATCH 3/4] Avoid use-after-free in GTK implementation of wxDataViewCtrl

 

The GTK implementation occasionally queries the model even during
destruction of the internal representation, so notify the widget before
modifying the model.
---
 eeschema/dialogs/dialog_lib_edit_pin_table.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp
index 4ba45eb..c66594f 100644
--- a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp
+++ b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp
@@ -417,6 +417,7 @@ void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::SetGroupingColumn( int aCol )
 
     m_GroupingColumn = aCol;
 
+    Cleared();
     CalculateGrouping();
     Refresh();
 }
@@ -455,8 +456,6 @@ void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Refresh()
 #ifdef REASSOCIATE_HACK
     m_Widget->AssociateModel( this );
 #else
-    Cleared();
-
     std::queue<wxDataViewItem> todo;
     todo.push( wxDataViewItem() );
 

Follow ups

References