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 ) ...@@ -216,8 +216,6 @@ SCH_ITEM* SCH_SCREEN::ExtractWires( bool CreateCopy )
*/ */
bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC ) bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
{ {
wxASSERT( aCanvas != NULL );
SCH_ITEM* DrawList, * TstDrawList; SCH_ITEM* DrawList, * TstDrawList;
bool Modify = FALSE; bool Modify = FALSE;
...@@ -674,10 +672,10 @@ bool SCH_SCREEN::TestDanglingEnds( EDA_DRAW_PANEL* aCanvas, wxDC* aDC ) ...@@ -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 ), g_XorMode );
item->Draw( aCanvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE ); item->Draw( aCanvas, aDC, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
if( item->IsDangling() )
hasDanglingEnds = true;
} }
if( item->IsDangling() )
hasDanglingEnds = true;
} }
return hasDanglingEnds; return hasDanglingEnds;
......
...@@ -65,6 +65,8 @@ SCH_SHEET::SCH_SHEET( const SCH_SHEET& aSheet ) : ...@@ -65,6 +65,8 @@ SCH_SHEET::SCH_SHEET( const SCH_SHEET& aSheet ) :
SCH_SHEET::~SCH_SHEET() SCH_SHEET::~SCH_SHEET()
{ {
wxLogDebug( wxT( "Destroying sheet " ) + m_SheetName );
// also, look at the associated sheet & its reference count // also, look at the associated sheet & its reference count
// perhaps it should be deleted also. // perhaps it should be deleted also.
if( m_AssociatedScreen ) if( m_AssociatedScreen )
......
This diff is collapsed.
This diff is collapsed.
...@@ -346,12 +346,23 @@ void SCH_EDIT_FRAME::CreateScreens() ...@@ -346,12 +346,23 @@ void SCH_EDIT_FRAME::CreateScreens()
void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
{ {
if( m_LibeditFrame && !m_LibeditFrame->Close() ) // Can close component editor? SCH_SHEET_PATH* sheet;
return;
if( m_LibeditFrame ) // Can close component editor ?
{
if( !m_LibeditFrame->Close() )
return;
}
SCH_SHEET_LIST SheetList; 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, wxMessageDialog dialog( this,
_( "Schematic modified, Save before exit ?" ), _( "Schematic modified, Save before exit ?" ),
...@@ -374,7 +385,15 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event ) ...@@ -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() if( !g_RootSheet->GetScreen()->GetFileName().IsEmpty()
&& (g_RootSheet->GetScreen()->GetDrawItems() != NULL) ) && (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