Commit da9f4b8a authored by Wayne Stambaugh's avatar Wayne Stambaugh

Undo schematic hierarchy path container changes.

* Boost container release method clobbering sheet pointers causing
  seg faults.
parent 3c49fb1e
......@@ -216,8 +216,6 @@ SCH_ITEM* SCH_SCREEN::ExtractWires( bool CreateCopy )
*/
bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
{
wxASSERT( aCanvas != NULL );
SCH_ITEM* DrawList, * TstDrawList;
bool Modify = FALSE;
......@@ -674,10 +672,10 @@ bool SCH_SCREEN::TestDanglingEnds( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
{
item->Draw( aCanvas, aDC, wxPoint( 0, 0 ), g_XorMode );
item->Draw( aCanvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
if( item->IsDangling() )
hasDanglingEnds = true;
}
if( item->IsDangling() )
hasDanglingEnds = true;
}
return hasDanglingEnds;
......
......@@ -65,6 +65,8 @@ SCH_SHEET::SCH_SHEET( const SCH_SHEET& aSheet ) :
SCH_SHEET::~SCH_SHEET()
{
wxLogDebug( wxT( "Destroying sheet " ) + m_SheetName );
// also, look at the associated sheet & its reference count
// perhaps it should be deleted also.
if( m_AssociatedScreen )
......
This diff is collapsed.
This diff is collapsed.
......@@ -346,12 +346,23 @@ void SCH_EDIT_FRAME::CreateScreens()
void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
if( m_LibeditFrame && !m_LibeditFrame->Close() ) // Can close component editor?
return;
SCH_SHEET_PATH* sheet;
if( m_LibeditFrame ) // Can close component editor ?
{
if( !m_LibeditFrame->Close() )
return;
}
SCH_SHEET_LIST SheetList;
if( SheetList.IsModified() )
for( sheet = SheetList.GetFirst(); sheet != NULL; sheet = SheetList.GetNext() )
{
if( sheet->LastScreen() && sheet->LastScreen()->IsModify() )
break;
}
if( sheet )
{
wxMessageDialog dialog( this,
_( "Schematic modified, Save before exit ?" ),
......@@ -374,7 +385,15 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
}
}
SheetList.ClearModifyStatus();
for( sheet = SheetList.GetFirst();
sheet != NULL;
sheet = SheetList.GetNext() )
{
if( sheet->LastScreen() )
{
sheet->LastScreen()->ClrModify();
}
}
if( !g_RootSheet->GetScreen()->GetFileName().IsEmpty()
&& (g_RootSheet->GetScreen()->GetDrawItems() != NULL) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment