Fixed some valgrind issues.

This commit is contained in:
Matthias Koefferlein 2021-04-08 23:30:47 +02:00
parent c4e5310c95
commit 870fd2e0bd
4 changed files with 10 additions and 6 deletions

View File

@ -357,10 +357,7 @@ CompoundRegionMultiInputOperationNode::init ()
CompoundRegionMultiInputOperationNode::~CompoundRegionMultiInputOperationNode ()
{
for (tl::shared_collection<CompoundRegionOperationNode>::iterator i = m_children.begin (); i != m_children.end (); ++i) {
delete i.operator-> ();
}
m_children.clear ();
// .. nothing yet ..
}
void

View File

@ -1626,7 +1626,7 @@ AreaMap::reinitialize (const db::Point &p0, const db::Vector &d, const db::Vecto
m_ny = ny;
if (mp_av) {
delete mp_av;
delete[] mp_av;
}
mp_av = new area_type [nx * ny];

View File

@ -99,6 +99,7 @@ void run_test1 (tl::TestBase *_this, bool deep)
unsigned int l1002 = ly.get_layer (db::LayerProperties (1002, 0));
res.insert_into (&ly, *ly.begin_top_down (), l1002);
primary = new db::CompoundRegionOperationPrimaryNode ();
db::CompoundRegionCheckOperationNode space_check (primary, db::SpaceRelation, false /*==all polygons*/, 1050, check_options);
res = r.cop_to_edge_pairs (space_check);

View File

@ -206,7 +206,13 @@ GDS2Reader::get_string ()
void
GDS2Reader::get_string (std::string &s) const
{
s.assign ((const char *) mp_rec_buf, 0, m_reclen);
if (m_reclen == 0) {
s.clear ();
} else if (mp_rec_buf [m_reclen - 1] != 0) {
s.assign ((const char *) mp_rec_buf, m_reclen);
} else {
s.assign ((const char *) mp_rec_buf, m_reclen - 1);
}
}
void