diff --git a/eeschema/dialogs/dialog_sheet_properties.cpp b/eeschema/dialogs/dialog_sheet_properties.cpp index 2d7c5dd919..6a7d9cf1cd 100644 --- a/eeschema/dialogs/dialog_sheet_properties.cpp +++ b/eeschema/dialogs/dialog_sheet_properties.cpp @@ -594,7 +594,7 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena if( useScreen ) { // Create a temporary sheet for recursion testing to prevent a possible recursion error. - std::unique_ptr< SCH_SHEET> tmpSheet = std::make_unique(); + std::unique_ptr< SCH_SHEET> tmpSheet = std::make_unique( &m_frame->Schematic() ); tmpSheet->GetFields()[SHEETNAME] = m_fields->at( SHEETNAME ); tmpSheet->GetFields()[SHEETFILENAME].SetText( sheetFileName.GetFullPath() ); tmpSheet->SetScreen( useScreen );