Commit 28222961 authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

fix ownership issue in wxFFile vs. FILE_LINE_READER

parent 5634bc33
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -983,7 +983,7 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const
void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
    throw( IO_ERROR )
    throw( IO_ERROR )
{
{
    std::string shape;
    const char* shape;


    switch( aPad->GetShape() )
    switch( aPad->GetShape() )
    {
    {
@@ -996,7 +996,7 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
        THROW_IO_ERROR( wxString::Format( _( "unknown pad type: %d"), aPad->GetShape() ) );
        THROW_IO_ERROR( wxString::Format( _( "unknown pad type: %d"), aPad->GetShape() ) );
    }
    }


    std::string type;
    const char* type;


    switch( aPad->GetAttribute() )
    switch( aPad->GetAttribute() )
    {
    {
@@ -1012,7 +1012,7 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const


    m_out->Print( aNestLevel, "(pad %s %s %s",
    m_out->Print( aNestLevel, "(pad %s %s %s",
                  m_out->Quotew( aPad->GetPadName() ).c_str(),
                  m_out->Quotew( aPad->GetPadName() ).c_str(),
                  type.c_str(), shape.c_str() );
                  type, shape );
    m_out->Print( 0, " (at %s", FMT_IU( aPad->GetPos0() ).c_str() );
    m_out->Print( 0, " (at %s", FMT_IU( aPad->GetPos0() ).c_str() );


    if( aPad->GetOrientation() != 0.0 )
    if( aPad->GetOrientation() != 0.0 )
@@ -1502,7 +1502,7 @@ BOARD* PCB_IO::Load( const wxString& aFileName, BOARD* aAppendToMe, PROPERTIES*
        THROW_IO_ERROR( msg );
        THROW_IO_ERROR( msg );
    }
    }


    FILE_LINE_READER    reader( file.fp(), aFileName );
    FILE_LINE_READER    reader( file.fp(), aFileName, false /* wxFFile owns fp */ );


    m_parser->SetLineReader( &reader );
    m_parser->SetLineReader( &reader );
    m_parser->SetBoard( aAppendToMe );
    m_parser->SetBoard( aAppendToMe );
+30 −30

File changed.

Contains only whitespace changes.