From 783f818f1965cfa1300fb49b0ff058a19986d34d Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Tue, 2 Feb 2016 11:54:54 -0500 Subject: [PATCH] Eeschema: fix segfault when drawing new sheet after deleting existing sheet with the same file. (fixes lp:1538510) --- eeschema/sheet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp index 95005c671e..93bdecfa4e 100644 --- a/eeschema/sheet.cpp +++ b/eeschema/sheet.cpp @@ -357,7 +357,7 @@ SCH_SHEET* SCH_EDIT_FRAME::CreateSheet( wxDC* aDC ) sheet->SetFlags( IS_NEW | IS_RESIZED ); sheet->SetTimeStamp( GetNewTimeStamp() ); - sheet->SetParent( GetScreen() ); + sheet->SetParent( GetCurrentSheet().Last() ); sheet->SetScreen( NULL ); // need to check if this is being added to the GetDrawItems().