fix memory leak of npy_file's move assignment
Checklist
- [x] The title and commit message(s) are descriptive.
- [ ] Small commits made to fix your PR have been squashed to avoid history pollution.
- [ ] Tests have been added for new features or bug fixes.
- [ ] API of new functions and classes are documented.
Description
Fix memory leak when one npy_file move to another npy_file.
Thanks! Sorry for not addressing this sooner. I'm not an expert on this part of the code, but I will try to help. Could you first rebase your PR on the current master in which the CI issues are fixed, such that we can take it from there?
Also, could you add a test case with which we could have found this bug?
This pr is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days.
Thanks! Sorry for not addressing this sooner. I'm not an expert on this part of the code, but I will try to help. Could you first rebase your PR on the current master in which the CI issues are fixed, such that we can take it from there?
Done!
Also, could you add a test case with which we could have found this bug?
This PR fix mem-leak of npy_file's move assignment method. It will leak when:
xt::detail::npy_file a = xt::detail::load_npy_file(fileName);
xt::detail::npy_file b = xt::detail::load_npy_file(fileName);
a = std::move(b); // original memory of a doesn't be freed before move.
This pr is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days.
Also, could you add a test case with which we could have found this bug?
This PR fix mem-leak of
npy_file's move assignment method. It will leak when:xt::detail::npy_file a = xt::detail::load_npy_file(fileName); xt::detail::npy_file b = xt::detail::load_npy_file(fileName); a = std::move(b); // original memory of a doesn't be freed before move.
Could you add this to the tests? Thanks!
This pr is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days.
This issue was closed because it has been inactive for 14 days since being marked as stale.