Commit 51efe030 authored by charras's avatar charras

Fixed, pcbnew: crashes when removing a 3D shape in dialog box (wxGTK specific)

parent 1873e058
No preview for this file type
This diff is collapsed.
...@@ -296,6 +296,16 @@ void DIALOG_MODULE_BOARD_EDITOR::On3DShapeNameSelected(wxCommandEvent& event) ...@@ -296,6 +296,16 @@ void DIALOG_MODULE_BOARD_EDITOR::On3DShapeNameSelected(wxCommandEvent& event)
if( m_LastSelected3DShapeIndex >= 0 ) if( m_LastSelected3DShapeIndex >= 0 )
TransfertDisplayTo3DValues( m_LastSelected3DShapeIndex ); TransfertDisplayTo3DValues( m_LastSelected3DShapeIndex );
m_LastSelected3DShapeIndex = m_3D_ShapeNameListBox->GetSelection(); m_LastSelected3DShapeIndex = m_3D_ShapeNameListBox->GetSelection();
if( m_LastSelected3DShapeIndex < 0 ) // happens under wxGTK when deleting an item in m_3D_ShapeNameListBox wxListBox
return;
if( m_LastSelected3DShapeIndex >= (int) m_Shapes3D_list.size() )
{
wxMessageBox(wxT("On3DShapeNameSelected() error"));
m_LastSelected3DShapeIndex = -1;
return;
}
Transfert3DValuesToDisplay( m_Shapes3D_list[m_LastSelected3DShapeIndex] ); Transfert3DValuesToDisplay( m_Shapes3D_list[m_LastSelected3DShapeIndex] );
} }
......
...@@ -174,6 +174,16 @@ void DIALOG_MODULE_MODULE_EDITOR::On3DShapeNameSelected(wxCommandEvent& event) ...@@ -174,6 +174,16 @@ void DIALOG_MODULE_MODULE_EDITOR::On3DShapeNameSelected(wxCommandEvent& event)
if( m_LastSelected3DShapeIndex >= 0 ) if( m_LastSelected3DShapeIndex >= 0 )
TransfertDisplayTo3DValues( m_LastSelected3DShapeIndex ); TransfertDisplayTo3DValues( m_LastSelected3DShapeIndex );
m_LastSelected3DShapeIndex = m_3D_ShapeNameListBox->GetSelection(); m_LastSelected3DShapeIndex = m_3D_ShapeNameListBox->GetSelection();
if( m_LastSelected3DShapeIndex < 0 ) // happens under wxGTK when deleting an item in m_3D_ShapeNameListBox wxListBox
return;
if( m_LastSelected3DShapeIndex >= (int)m_Shapes3D_list.size() )
{
wxMessageBox(wxT("On3DShapeNameSelected() error"));
m_LastSelected3DShapeIndex = -1;
return;
}
Transfert3DValuesToDisplay( m_Shapes3D_list[m_LastSelected3DShapeIndex] ); Transfert3DValuesToDisplay( m_Shapes3D_list[m_LastSelected3DShapeIndex] );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment