diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp index 9fc1589a21..1ae6f8a856 100644 --- a/pcbnew/class_board_item.cpp +++ b/pcbnew/class_board_item.cpp @@ -222,7 +222,7 @@ int BOARD_ITEM::getTrailingInt( wxString aStr ) int BOARD_ITEM::getNextNumberInSequence( std::set aSeq, bool aFillSequenceGaps) { // By default go to the end of the sequence - int candidate = *aSeq.end(); + int candidate = *aSeq.rbegin(); // Filling in gaps in pad numbering if( aFillSequenceGaps ) diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index cf03185ab3..a7d95e38fa 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -272,6 +272,8 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event ) // Only use settings if all values are good if( ok ) newSettings = newGrid; + else + delete newGrid; } else if( page == m_circularPanel ) { @@ -301,6 +303,8 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event ) // Only use settings if all values are good if( ok ) newSettings = newCirc; + else + delete newCirc; } // If we got good settings, send them out and finish diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 4ed16f26bb..b602104af6 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -49,7 +49,8 @@ EDIT_TOOL::EDIT_TOOL() : TOOL_INTERACTIVE( "pcbnew.InteractiveEdit" ), m_selectionTool( NULL ), - m_dragging( false ), m_editModules( false ), m_updateFlag( KIGFX::VIEW_ITEM::NONE ) + m_dragging( false ), m_editModules( false ), m_undoInhibit( 0 ), + m_updateFlag( KIGFX::VIEW_ITEM::NONE ) { }