Commit 51efe030 authored by charras's avatar charras
Browse files

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

parent 1873e058
Loading
Loading
Loading
Loading
+48 B (186 KiB)

File changed.

No diff preview for this file type.

+799 −741

File changed.

Preview size limit exceeded, changes collapsed.

+10 −0
Original line number Diff line number Diff line
@@ -296,6 +296,16 @@ void DIALOG_MODULE_BOARD_EDITOR::On3DShapeNameSelected(wxCommandEvent& event)
    if( m_LastSelected3DShapeIndex >= 0 )
        TransfertDisplayTo3DValues( m_LastSelected3DShapeIndex );
    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] );
}

+10 −0
Original line number Diff line number Diff line
@@ -174,6 +174,16 @@ void DIALOG_MODULE_MODULE_EDITOR::On3DShapeNameSelected(wxCommandEvent& event)
    if( m_LastSelected3DShapeIndex >= 0 )
        TransfertDisplayTo3DValues( m_LastSelected3DShapeIndex );
    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] );
}