Skip to content

Commit

Permalink
fix memory leak in get_array_metadata (NanoComp#1447)
Browse files Browse the repository at this point in the history
* fix memory leak in get_array_metadata

* Update array_slice.cpp
  • Loading branch information
stevengj authored Dec 16, 2020
1 parent d556ebd commit 8661498
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/array_slice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ std::vector<double> fields::get_array_metadata(const volume &where, bool collaps
for (unsigned nw = 0; nw < (nxyz[0] * nxyz[1] * nxyz[2]); nw++)
xyzw.push_back(weights[nw]);

delete[] weights;
return xyzw;

} // get_array_metadata
Expand Down

0 comments on commit 8661498

Please sign in to comment.