gmx_mtop c++ change exposing bugs in gmx trjconv
The recent change to port gmx_mtop to c++ has exposed some memory corruption bugs in gmx trjconv.
They seem to be related to the use (and subsequent free'ing) of the legacy topology structure that is based on some data structures that are already free'd because the c++ topology has been released at this point.
To fix the issue the gen_local_top routine needs to make explicit copies instead of using pointers to the mtop data structures.
Fix legacy topology memory error
The change to port mtop to c++ has exposed a number of issues in the
legacy topology data structure, where pointers would be copied from a
temporary mtop object to the local topology, and subsequently
invalidated when mtop was correctly free'd.
This change is a bit of wooden mallet applied to the problem, by brute
forcing the assignment of the values that were previously copied by