Commit 3b1ddd95 authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio
Browse files

Removed the SAFE_DELETE macro.

In most case the assignment to null was not necessary since it was easily provable that the (local) variable wouldn't have referenced after that anyway.
parent 3c5c795c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -168,7 +168,8 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* aParent,


EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
{
{
    SAFE_DELETE( m_currentScreen );
    delete m_currentScreen;
    m_currentScreen = NULL;


    m_auimgr.UnInit();
    m_auimgr.UnInit();
}
}
+3 −3
Original line number Original line Diff line number Diff line
@@ -868,7 +868,7 @@ bool LIB_COMPONENT::LoadDrawEntries( LINE_READER& aLineReader, wxString& aErrorM
        {
        {
            aErrorMsg.Printf( wxT( "error <%s> in DRAW command %c" ),
            aErrorMsg.Printf( wxT( "error <%s> in DRAW command %c" ),
                              GetChars( aErrorMsg ), line[0] );
                              GetChars( aErrorMsg ), line[0] );
            SAFE_DELETE( newEntry );
            delete newEntry;


            // Flush till end of draw section
            // Flush till end of draw section
            do
            do
@@ -913,7 +913,7 @@ bool LIB_COMPONENT::LoadField( LINE_READER& aLineReader, wxString& aErrorMsg )


    if( !field->Load( aLineReader, aErrorMsg ) )
    if( !field->Load( aLineReader, aErrorMsg ) )
    {
    {
        SAFE_DELETE( field );
        delete field;
        return false;
        return false;
    }
    }


@@ -931,7 +931,7 @@ bool LIB_COMPONENT::LoadField( LINE_READER& aLineReader, wxString& aErrorMsg )
        if( field->GetId() == VALUE )
        if( field->GetId() == VALUE )
            m_name = field->GetText();
            m_name = field->GetText();


        SAFE_DELETE( field );
        delete field;
    }
    }
    else
    else
    {
    {
+1 −1
Original line number Original line Diff line number Diff line
@@ -247,7 +247,7 @@ void DIALOG_ERC::ReBuildMatrixPanel()
    wxStaticText* text = new wxStaticText( m_matrixPanel, -1, wxT( "W" ), pos );
    wxStaticText* text = new wxStaticText( m_matrixPanel, -1, wxT( "W" ), pos );
    int text_height   = text->GetRect().GetHeight();
    int text_height   = text->GetRect().GetHeight();
    bitmap_size.y = std::max( bitmap_size.y, text_height );
    bitmap_size.y = std::max( bitmap_size.y, text_height );
    SAFE_DELETE( text );
    delete text;


    // compute the Y pos interval:
    // compute the Y pos interval:
    pos.y = text_height;
    pos.y = text_height;
+1 −1
Original line number Original line Diff line number Diff line
@@ -110,7 +110,7 @@ SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( wxDC* aDC, int aType )


    if( textItem->GetText().IsEmpty() )
    if( textItem->GetText().IsEmpty() )
    {
    {
        SAFE_DELETE( textItem );
        delete textItem;
        return NULL;
        return NULL;
    }
    }


+2 −1
Original line number Original line Diff line number Diff line
@@ -293,7 +293,8 @@ bool SCH_EDIT_FRAME::LoadOneEEProject( const wxString& aFileName, bool aIsNew )
    // Clear the screen before open a new file
    // Clear the screen before open a new file
    if( g_RootSheet )
    if( g_RootSheet )
    {
    {
        SAFE_DELETE( g_RootSheet );
        delete g_RootSheet;
        g_RootSheet = NULL;
    }
    }


    CreateScreens();
    CreateScreens();
Loading