diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index f1b4d2903d..137943be7b 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -830,8 +830,6 @@ MODULE* PCB_BASE_FRAME::CreateNewModule( const wxString& aModuleName ) // Creates the new module and add it to the head of the linked list of modules MODULE* module = new MODULE( GetBoard() ); - GetBoard()->Add( module ); - // Update parameters: timestamp ... module->SetLastEditTime(); diff --git a/pcbnew/microwave.cpp b/pcbnew/microwave.cpp index 5ad0ced945..fe39ff40fa 100644 --- a/pcbnew/microwave.cpp +++ b/pcbnew/microwave.cpp @@ -187,6 +187,7 @@ MODULE* PCB_EDIT_FRAME::CreateMuWaveBaseFootprint( const wxString& aValue, int aTextSize, int aPadCount ) { MODULE* module = CreateNewModule( aValue ); + AddModuleToBoard( module ); if( aTextSize > 0 ) { diff --git a/pcbnew/microwave/microwave_inductor.cpp b/pcbnew/microwave/microwave_inductor.cpp index 9e0e1edac2..90f399fec8 100644 --- a/pcbnew/microwave/microwave_inductor.cpp +++ b/pcbnew/microwave/microwave_inductor.cpp @@ -343,8 +343,8 @@ MODULE* MWAVE::CreateMicrowaveInductor( INDUCTOR_PATTERN& inductorPattern, return nullptr; // Aborted by user MODULE* module = aPcbFrame->CreateNewModule( msg ); + aPcbFrame->AddModuleToBoard( module ); - // here the module is already in the BOARD, CreateNewModule() does that. module->SetFPID( LIB_ID( wxString( "mw_inductor" ) ) ); module->SetAttributes( MOD_VIRTUAL | MOD_CMS ); module->ClearFlags();