mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
EEschema: fix crash when repeat an item (ins key), due to a null parent
A recent change set the parent member of a item put in the repeat list to nullptr (this is OK) but the code to copy an item from this list did not update this parent member.
This commit is contained in:
parent
87cf37c847
commit
8f348820f3
@ -1418,6 +1418,10 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent )
|
||||
EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
|
||||
bool restore_state = false;
|
||||
|
||||
// Ensure newItem has a suitable parent: the current screen, because an item from
|
||||
// a list of items to repeat must be attached to this current screen
|
||||
newItem->SetParent( m_frame->GetScreen() );
|
||||
|
||||
if( SCH_LABEL_BASE* label = dynamic_cast<SCH_LABEL_BASE*>( newItem ) )
|
||||
{
|
||||
// If incrementing tries to go below zero, tell user why the value is repeated
|
||||
|
Loading…
x
Reference in New Issue
Block a user