Assign stack pointer to lib table

When creating new lib table rows, the pointer becomes managed by the new
table through the boost::ptr_vector.  The row is non-copyable, however,
so we lose the reference as soon as it goes out of scope. Creating a
clone provides a new pointer that is moved into the table on creation.

Fixes: lp:1792456
* https://bugs.launchpad.net/kicad/+bug/1792456
This commit is contained in:
Seth Hillbrand 2019-02-03 05:11:12 +01:00
parent b461fc44ef
commit c08736e245
2 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ protected:
tbl->AppendRows( tmp_tbl.GetCount() - tbl->GetNumberRows() );
for( int i = 0; i < tmp_tbl.GetCount(); ++i )
tbl->rows.replace( i, tmp_tbl.At( i ) );
tbl->rows.replace( i, tmp_tbl.At( i )->clone() );
}
m_grid->AutoSizeColumns( false );

View File

@ -249,7 +249,7 @@ protected:
tbl->AppendRows( tmp_tbl.GetCount() - tbl->GetNumberRows() );
for( int i = 0; i < tmp_tbl.GetCount(); ++i )
tbl->rows.replace( i, tmp_tbl.At( i ) );
tbl->rows.replace( i, tmp_tbl.At( i )->clone() );
}
m_grid->AutoSizeColumns( false );