Skip to content

Commit

Permalink
Fix memory leaks (NanoComp#1839)
Browse files Browse the repository at this point in the history
* Fix memory leaks

* Add kkg to authors list
  • Loading branch information
kkg4theweb authored and Mo Chen committed Feb 16, 2022
1 parent 8b28cf8 commit e0ebe9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/GDSIIgeom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ geometric_object get_GDSII_prism(material_type material, const char *GDSIIFile,
dVec polygon = get_polygon(GDSIIFile, Text, Layer);

int num_vertices = polygon.size() / 2;
<<<<<<< HEAD
std::unique_ptr<vector3[]> vertices(new vector3[num_vertices]);
=======
auto vertices = std::make_unique<vector3[]>(num_vertices);
>>>>>>> Fix memory leaks (#1839)
for (int nv = 0; nv < num_vertices; nv++) {
vertices[nv].x = polygon[2 * nv + 0];
vertices[nv].y = polygon[2 * nv + 1];
Expand Down

0 comments on commit e0ebe9b

Please sign in to comment.