memory leak, comments

This commit is contained in:
Dick Hollenbeck 2013-10-30 00:14:11 -05:00
parent c1ec14bcac
commit 416c44615a
3 changed files with 13 additions and 9 deletions

View File

@ -388,15 +388,17 @@ std::string FP_LIB_TABLE::FormatOptions( const PROPERTIES* aProperties )
// the separation between name and value is '=' // the separation between name and value is '='
if( value.size() ) if( value.size() )
{
ret += '='; ret += '=';
for( std::string::const_iterator si = value.begin(); si != value.end(); ++si ) for( std::string::const_iterator si = value.begin(); si != value.end(); ++si )
{ {
// escape any separator in the value. // escape any separator in the value.
if( *si == OPT_SEP ) if( *si == OPT_SEP )
ret += '\\'; ret += '\\';
ret += *si; ret += *si;
}
} }
} }
} }

View File

@ -51,7 +51,7 @@ public:
SetTitle( title ); SetTitle( title );
// add Cut, Copy, and Paste to wxGrids // add Cut, Copy, and Paste to wxGrid
m_grid->PushEventHandler( new GRID_TRICKS( m_grid ) ); m_grid->PushEventHandler( new GRID_TRICKS( m_grid ) );
string options = TO_UTF8( aOptions ); string options = TO_UTF8( aOptions );
@ -60,7 +60,8 @@ public:
if( props ) if( props )
{ {
m_grid->AppendRows( props->size() ); if( props->size() > m_grid->GetNumberRows() )
m_grid->AppendRows( props->size() - m_grid->GetNumberRows() );
int row = 0; int row = 0;
for( PROPERTIES::const_iterator it = props->begin(); it != props->end(); ++it, ++row ) for( PROPERTIES::const_iterator it = props->begin(); it != props->end(); ++it, ++row )
@ -68,6 +69,8 @@ public:
m_grid->SetCellValue( row, 0, FROM_UTF8( it->first.c_str() ) ); m_grid->SetCellValue( row, 0, FROM_UTF8( it->first.c_str() ) );
m_grid->SetCellValue( row, 1, FROM_UTF8( it->second.c_str() ) ); m_grid->SetCellValue( row, 1, FROM_UTF8( it->second.c_str() ) );
} }
delete props;
} }
if( !col_width_option ) if( !col_width_option )

View File

@ -188,7 +188,6 @@ install_or_update()
if [ $# -eq 1 -a "$1" == "--remove-sources" ]; then if [ $# -eq 1 -a "$1" == "--remove-sources" ]; then
# run this only once, kills .config & makes dirs
echo "deleting $WORKING_TREES" echo "deleting $WORKING_TREES"
rm_build_dir "$WORKING_TREES/kicad.bzr/build" rm_build_dir "$WORKING_TREES/kicad.bzr/build"
rm_build_dir "$WORKING_TREES/kicad-lib.bzr/build" rm_build_dir "$WORKING_TREES/kicad-lib.bzr/build"