Commit 505b3841 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Removed a few memory leaks.

parent 75026d87
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -220,6 +220,7 @@ set( PCB_COMMON_SRCS
    ../pcbnew/class_zone_settings.cpp
    ../pcbnew/classpcb.cpp
    ../pcbnew/ratsnest_data.cpp
    ../pcbnew/ratsnest_viewitem.cpp
    ../pcbnew/collectors.cpp
    ../pcbnew/netlist_reader.cpp
    ../pcbnew/legacy_netlist_reader.cpp
+1 −3
Original line number Diff line number Diff line
@@ -36,10 +36,8 @@

using namespace KIGFX;

WORKSHEET_VIEWITEM::WORKSHEET_VIEWITEM( const std::string& aFileName, const std::string& aSheetName,
                                const PAGE_INFO* aPageInfo, const TITLE_BLOCK* aTitleBlock ) :
WORKSHEET_VIEWITEM::WORKSHEET_VIEWITEM( const PAGE_INFO* aPageInfo, const TITLE_BLOCK* aTitleBlock ) :
    EDA_ITEM( NOT_USED ), // this item is never added to a BOARD so it needs no type
    m_fileName( aFileName ), m_sheetName( aSheetName ),
    m_titleBlock( aTitleBlock ), m_pageInfo( aPageInfo ), m_sheetNumber( 1 ), m_sheetCount( 1 ) {}


+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <climits>
#include <iostream>
#include <sstream>
#include <cmath>

#include <math/math_util.h>

+1 −2
Original line number Diff line number Diff line
@@ -47,8 +47,7 @@ class GAL;
class WORKSHEET_VIEWITEM : public EDA_ITEM
{
public:
    WORKSHEET_VIEWITEM( const std::string& aFileName, const std::string& aSheetName,
                    const PAGE_INFO* aPageInfo, const TITLE_BLOCK* aTitleBlock );
    WORKSHEET_VIEWITEM( const PAGE_INFO* aPageInfo, const TITLE_BLOCK* aTitleBlock );

    /**
     * Function SetFileName()
+10 −1
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@
#include <reporter.h>
#include <base_units.h>
#include <ratsnest_data.h>
#include <ratsnest_viewitem.h>
#include <worksheet_viewitem.h>

#include <pcbnew.h>
#include <colors_selection.h>
@@ -104,7 +106,13 @@ BOARD::BOARD() :

    SetCurrentNetClass( m_NetClasses.GetDefault()->GetName() );

    // Initialize ratsnest
    m_ratsnest = new RN_DATA( this );
    m_ratsnestViewItem = new KIGFX::RATSNEST_VIEWITEM( m_ratsnest );

    // Initialize view item for displaying worksheet frame
    m_worksheetViewItem = new KIGFX::WORKSHEET_VIEWITEM( &m_paper, &m_titles );
    m_worksheetViewItem->SetFileName( std::string( m_fileName.mb_str() ) );
}


@@ -116,10 +124,11 @@ BOARD::~BOARD()
        Delete( area_to_remove );
    }

    delete m_worksheetViewItem;
    delete m_ratsnestViewItem;
    delete m_ratsnest;

    m_FullRatsnest.clear();

    m_LocalRatsnest.clear();

    DeleteMARKERs();
Loading