Fix most memory leaks recently introduced
commit40e358ec78e57cff212fd0bdcec179119b9a9741
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 14 Oct 2016 18:32:35 +0000 (14 21:32 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Sat, 15 Oct 2016 03:09:12 +0000 (15 06:09 +0300)
tree1af8c8b00eb562597a8c18461a2fcaffe8f836e6
parent921ec7cb9e8edbb3ff5fc3870d497d7bb016ae1a
Fix most memory leaks recently introduced

- Do not overwrite memory allocated in init_mtop() when creating
  molecules in selection tests.
- Add function to properly deallocate t_topology and gmx_mtop_t when
  gmx_mtop_t_to_t_topology(..., false) has been called.
- Free all memory in done_mtop().

These should be enough to (again) make the unit tests free of memory
leaks, except that t_state.enerhist is leaked in a few places.  That
requires more complicated handling.

Change-Id: I84b853b9cb8a11c0458ea4f29316a83a41d7ae22
src/gromacs/fileio/tpxio.cpp
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/insert-molecules.cpp
src/gromacs/selection/tests/toputils.cpp
src/gromacs/topology/mtop_util.cpp
src/gromacs/topology/topology.cpp
src/gromacs/topology/topology.h
src/gromacs/trajectoryanalysis/analysissettings.cpp