Don't store address of temp object.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15517
This commit is contained in:
parent
a470cab7b2
commit
b5dc9ddbe0
|
@ -490,8 +490,8 @@ void SCH_COMMIT::Revert()
|
|||
|
||||
if( field->GetId() == REFERENCE_FIELD )
|
||||
{
|
||||
symbol->SetRef( schematic->GetSheets().FindSheetForScreen( screen ),
|
||||
field->GetText() );
|
||||
SCH_SHEET_PATH sheet = schematic->GetSheets().FindSheetForScreen( screen );
|
||||
symbol->SetRef( &sheet, field->GetText() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1045,15 +1045,15 @@ SCH_SHEET_PATH* SCH_SHEET_LIST::FindSheetForPath( const SCH_SHEET_PATH* aPath )
|
|||
}
|
||||
|
||||
|
||||
SCH_SHEET_PATH* SCH_SHEET_LIST::FindSheetForScreen( const SCH_SCREEN* aScreen )
|
||||
SCH_SHEET_PATH SCH_SHEET_LIST::FindSheetForScreen( const SCH_SCREEN* aScreen )
|
||||
{
|
||||
for( SCH_SHEET_PATH& sheetpath : *this )
|
||||
{
|
||||
if( sheetpath.LastScreen() == aScreen )
|
||||
return &sheetpath;
|
||||
return sheetpath;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return SCH_SHEET_PATH();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -573,10 +573,10 @@ public:
|
|||
SCH_SHEET_PATH* FindSheetForPath( const SCH_SHEET_PATH* aPath );
|
||||
|
||||
/**
|
||||
* Return a pointer to the first #SCH_SHEET_PATH object (not necessarily the only one) using
|
||||
* a particular screen.
|
||||
* Return the first #SCH_SHEET_PATH object (not necessarily the only one) using a particular
|
||||
* screen.
|
||||
*/
|
||||
SCH_SHEET_PATH* FindSheetForScreen( const SCH_SCREEN* aScreen );
|
||||
SCH_SHEET_PATH FindSheetForScreen( const SCH_SCREEN* aScreen );
|
||||
|
||||
/**
|
||||
* Return a #SCH_SHEET_LIST with a copy of all the #SCH_SHEET_PATH using a particular screen.
|
||||
|
|
|
@ -313,7 +313,7 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
|||
}
|
||||
else if( status == UNDO_REDO::PAGESETTINGS )
|
||||
{
|
||||
SCH_SHEET_PATH& undoSheet = *m_schematic->GetSheets().FindSheetForScreen( screen );
|
||||
SCH_SHEET_PATH undoSheet = m_schematic->GetSheets().FindSheetForScreen( screen );
|
||||
|
||||
if( GetCurrentSheet() != undoSheet )
|
||||
{
|
||||
|
@ -355,8 +355,8 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
|
|||
|
||||
if( field->GetId() == REFERENCE_FIELD )
|
||||
{
|
||||
symbol->SetRef( m_schematic->GetSheets().FindSheetForScreen( screen ),
|
||||
field->GetText() );
|
||||
SCH_SHEET_PATH sheet = m_schematic->GetSheets().FindSheetForScreen( screen );
|
||||
symbol->SetRef( &sheet, field->GetText() );
|
||||
}
|
||||
|
||||
bulkChangedItems.emplace_back( symbol );
|
||||
|
|
Loading…
Reference in New Issue