hannorein / rebound

💫 An open-source multi-purpose N-body code.
https://rebound.readthedocs.io/
GNU General Public License v3.0
849 stars 219 forks source link

Properly free tree cells in reb_tree_delete_cell #649

Closed alchzh closed 1 year ago

alchzh commented 1 year ago

I think there was a missing call to free() here (the function does... nothing at the moment)

Fixes a small memory leak reported in valgrind.

hannorein commented 1 year ago

Ha. Thanks for that. I believe you're right.

I think this function only gets called if one deletes the entire tree (typically only at the end of a simulation). I don't think it affects the code while it's running. That might explain why it has not been noticed before.